Use storage under /data

This commit is contained in:
PCoder 2022-09-23 08:18:38 +05:30
parent 127a9ab8ec
commit 929d279b24
2 changed files with 8 additions and 8 deletions

View file

@ -35,14 +35,14 @@ RUN pip wheel --no-cache-dir --no-deps --wheel-dir /usr/src/gmba_django/wheels -
FROM python:3.9.6-alpine
# create directory for the app user
RUN mkdir -p /home/app
RUN mkdir -p /data/app
# create the app user
RUN addgroup -S app && adduser -S app -G app
# create the appropriate directories
ENV HOME=/home/app
ENV APP_HOME=/home/app/app
ENV HOME=/data/app
ENV APP_HOME=/data/app/app
RUN mkdir $APP_HOME
RUN mkdir $APP_HOME/static
RUN mkdir $APP_HOME/media

View file

@ -7,8 +7,8 @@ services:
dockerfile: Dockerfile.prod
command: gunicorn gmba_django.wsgi:application --bind [::]:8000
volumes:
- static_volume:/home/app/app/static
- media_volume:/home/app/app/media
- static_volume:/data/app/app/static
- media_volume:/data/app/app/media
expose:
- 8000
env_file:
@ -18,14 +18,14 @@ services:
db:
image: postgres:13.0-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
- postgres_data:/data/var/lib/postgresql/data/
env_file:
- ./.env.prod
nginx:
build: ./nginx
volumes:
- static_volume:/home/app/app/static
- media_volume:/home/app/app/media
- static_volume:/data/app/app/static
- media_volume:/data/app/app/media
ports:
- 1337:80
depends_on: