@@ -28,25 +28,12 @@ COPY admin_site/sys-requirements.txt sys-requirements.txt
2828
2929# hadolint ignore=SC2046,DL3008
3030RUN set -ex \
31- # Add a bpc group and user. Note: this is a system user/group, but have
32- # UID/GID above the normal SYS_UID_MAX/SYS_GID_MAX of 999, but also above the
33- # automatic ranges of UID_MAX/GID_MAX used by useradd/groupadd. See
34- # `/etc/login.defs`. Hopefully there will be no conflicts with users of the
35- # host system or users of other docker containers.
36- && groupadd -g 75030 -r bpc\
37- && useradd -u 75030 --no-log-init -r -g bpc bpc \
3831 # Install system dependencies from file.
3932 && apt-get -y update \
4033 && apt-get -y install --no-install-recommends $(grep -o '^[^#][[:alnum:].-]*' sys-requirements.txt) \
4134 # clean up after apt-get and man-pages
4235 && apt-get clean \
43- && rm -rf "/var/lib/apt/lists/*" "/tmp/*" "/var/tmp/*" "/usr/share/man/??" "/usr/share/man/??_*" \
44- # create folders at easily mountable paths for output from django
45- && install -o bpc -g bpc -d /log \
46- && install -o bpc -g bpc -d /media
47-
48- VOLUME /log
49- VOLUME /media
36+ && rm -rf "/var/lib/apt/lists/*" "/tmp/*" "/var/tmp/*" "/usr/share/man/??" "/usr/share/man/??_*"
5037
5138WORKDIR /code/
5239
@@ -106,8 +93,8 @@ RUN set -ex \
10693 && BPC_USER_CONFIG_PATH=/code/docker/insecure-settings.ini python ./manage.py compilemessages \
10794 && rm /code/docker/insecure-settings.ini
10895
109- # Run the server as the bpc user on port 9999
110- USER bpc:bpc
96+ # Run the server as non-root user on port 9999
97+ USER 1001
11198EXPOSE 9999
11299EXPOSE 8080
113100ENTRYPOINT ["/code/docker/docker-entrypoint.sh" ]
0 commit comments