#2: serve static and media files via nginx
This commit is contained in:
parent
3c1fec3f63
commit
0fdf7029e4
3 changed files with 24 additions and 1 deletions
|
|
@ -11,4 +11,12 @@ server {
|
|||
proxy_set_header Host $host;
|
||||
proxy_redirect off;
|
||||
}
|
||||
|
||||
location /staticfiles {
|
||||
alias /srv/http/staticfiles;
|
||||
}
|
||||
|
||||
location /mediafiles {
|
||||
alias /srv/http/mediafiles;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ services:
|
|||
expose:
|
||||
- 8000
|
||||
volumes:
|
||||
- static_volume:/usr/src/app/staticfiles
|
||||
- media_volume:/usr/src/app/mediafiles
|
||||
- /run/mysqld/:/run/mysqld/
|
||||
env_file:
|
||||
- production.secrets.env
|
||||
|
|
@ -14,5 +16,12 @@ services:
|
|||
build: ../nginx
|
||||
ports:
|
||||
- 8042:80
|
||||
volumes:
|
||||
- static_volume:/srv/http/staticfiles
|
||||
- media_volume:/srv/http/mediafiles
|
||||
depends_on:
|
||||
- django
|
||||
|
||||
volumes:
|
||||
static_volume:
|
||||
media_volume:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue