Skip to content
This repository was archived by the owner on Apr 14, 2026. It is now read-only.

Commit 198cc1c

Browse files
committed
Upgrade to use Python 3.10
This also restructures the Dockerfile a little bit, to not create some unnecessary layers. Running `COPY ...` and then `RUN chown` as separate lines will create big duplicate layers, when you can do that same thing in one layer with `COPY --chown`.
1 parent d8992ae commit 198cc1c

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
21
#
32
# Launch a build container so we do not need to care about junk in the production image
43
#
5-
FROM python:3.8 AS build
4+
FROM python:3.10 AS build
65

76
# This is needed to start the Django app
87
ARG SECRET_KEY=none
@@ -35,21 +34,21 @@ RUN rm db.sqlite3
3534
#
3635
# The production container
3736
#
38-
FROM python:3.8
37+
FROM python:3.10
3938
EXPOSE 8080
4039

41-
COPY --from=build /app /app
40+
RUN adduser --no-create-home --gecos FALSE --disabled-password finger
4241

4342
RUN apt-get update \
4443
&& apt-get -y install nginx ruby-sass \
4544
&& rm -rf /var/lib/apt/lists/*
4645

46+
COPY --from=build --chown=finger /app /app
47+
4748
RUN pip install -r /app/requirements.txt
4849
WORKDIR /app
4950

50-
RUN adduser --no-create-home --gecos FALSE --disabled-password finger \
51-
&& sed -i "s/XXX_BUILD_DATE_XXX/`date +'%F %T'`/" /app/fingerweb/settings.py \
52-
&& chown -R finger:finger /app
51+
RUN sed -i "s/XXX_BUILD_DATE_XXX/`date +'%F %T'`/" /app/fingerweb/settings.py
5352

5453
ADD conf/nginx.conf /etc/nginx/nginx.conf
5554
ADD entrypoint.sh /app/entrypoint.sh

0 commit comments

Comments
 (0)