Skip to content

Commit e43f62e

Browse files
authored
Dockerfile: collect static as web user (#818)
1 parent 7eb0b49 commit e43f62e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

{{ cookiecutter.name }}/Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LABEL maintainer="{{ cookiecutter.email }}"
3737

3838
ENV DEBIAN_FRONTEND=noninteractive
3939
ENV PYTHONUNBUFFERED=1
40-
ENV STATIC_ROOT=/var/lib/django-static
40+
ENV STATIC_ROOT=/code/static
4141
# Define user ids to ensure consistent permissions, e.g., for mounted volumes
4242
ENV UID=999 GID=999
4343

@@ -55,11 +55,10 @@ ENV PATH="/code/.venv/bin:$PATH"
5555

5656
WORKDIR /code/src
5757

58+
USER web
5859
RUN python manage.py compilemessages
5960
RUN python manage.py collectstatic --noinput
6061

61-
USER web
62-
6362
# Also to mark that when CMD is used in shell form, it is a conscious decision
6463
SHELL ["/bin/bash", "-c"]
6564

0 commit comments

Comments
 (0)