Skip to content

Commit

Permalink
rename user
Browse files Browse the repository at this point in the history
  • Loading branch information
matthew-shaw committed Jun 5, 2024
1 parent 066ea5a commit cb8b76e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM python:3.12-slim

RUN useradd containeruser
RUN useradd appuser

WORKDIR /home/containeruser
WORKDIR /home/appuser

# Set environment variables
ENV FLASK_APP=govuk-frontend-flask.py \
Expand All @@ -12,6 +12,6 @@ ENV FLASK_APP=govuk-frontend-flask.py \
COPY app app
COPY govuk-frontend-flask.py config.py requirements.txt ./
RUN pip install -r requirements.txt \
&& chown -R containeruser:containeruser ./
&& chown -R appuser:appuser ./

USER containeruser
USER appuser
4 changes: 2 additions & 2 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ services:
- SERVICE_PHASE=[phase]
- SERVICE_URL=[url of service]
volumes:
- static_volume:/home/containeruser/app/static:rw
- static_volume:/home/appuser/app/static:rw
expose:
- 5000
depends_on:
Expand All @@ -30,7 +30,7 @@ services:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- ./cert.pem:/root/ssl/cert.pem
- ./key.pem:/root/ssl/key.pem
- static_volume:/home/containeruser/app/static:ro
- static_volume:/home/appuser/app/static:ro
ports:
- 443:443
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ server {

location /assets/ {
# handle static files directly, without forwarding to the application
alias /home/containeruser/app/static/;
alias /home/appuser/app/static/;
expires 1y;
}
}

0 comments on commit cb8b76e

Please sign in to comment.