Add media files config

This commit is contained in:
PCoder 2022-09-19 13:35:02 +05:30
parent 3eb5ba12d9
commit 0123fd2eef
3 changed files with 10 additions and 0 deletions

View File

@ -45,6 +45,7 @@ ENV HOME=/home/app
ENV APP_HOME=/home/app/app
RUN mkdir $APP_HOME
RUN mkdir $APP_HOME/static
RUN mkdir $APP_HOME/media
WORKDIR $APP_HOME
# install dependencies

View File

@ -8,6 +8,7 @@ services:
command: gunicorn gmba_django.wsgi:application --bind 0.0.0.0:8000
volumes:
- static_volume:/home/app/app/static
- media_volume:/home/app/app/media
expose:
- 8000
env_file:
@ -24,6 +25,7 @@ services:
build: ./nginx
volumes:
- static_volume:/home/app/app/static
- media_volume:/home/app/app/media
ports:
- 1337:80
depends_on:
@ -32,3 +34,4 @@ services:
volumes:
postgres_data:
static_volume:
media_volume:

View File

@ -16,6 +16,12 @@ server {
location /static/ {
alias /home/app/app/static/;
expires max;
}
location /media/ {
alias /home/app/app/media/;
expires max;
}
add_header Content-Security-Policy "frame-ancestors https://www.gmba.unibe.ch"