From cb8b76e9a1a36fb9db2653ed411c2bf4c6a495a2 Mon Sep 17 00:00:00 2001 From: Matt Shaw Date: Wed, 5 Jun 2024 12:10:08 +0100 Subject: [PATCH] rename user --- Dockerfile | 8 ++++---- compose.yml | 4 ++-- nginx.conf | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index a99a9f5..189b2fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ @@ -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 \ No newline at end of file +USER appuser \ No newline at end of file diff --git a/compose.yml b/compose.yml index 5ccac70..329b7d7 100644 --- a/compose.yml +++ b/compose.yml @@ -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: @@ -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: diff --git a/nginx.conf b/nginx.conf index bd89ae6..9d5fc54 100644 --- a/nginx.conf +++ b/nginx.conf @@ -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; } } \ No newline at end of file