Skip to content

Commit

Permalink
feat: Implement nginx serving media file
Browse files Browse the repository at this point in the history
  • Loading branch information
ljy2855 committed Feb 19, 2024
1 parent f950de5 commit 3e93f46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ services:
build: ./app
volumes:
- static_volunme:/home/app/web/static
- media_volume:/home/app/web/media
command: gunicorn cspc_web.wsgi:application -w 4 --bind 0.0.0.0:8000
env_file:
- ./app/.env
Expand All @@ -16,6 +17,7 @@ services:
build: ./nginx
volumes:
- static_volunme:/home/app/web/static
- media_volume:/home/app/web/media
ports:
- 8004:80
depends_on:
Expand All @@ -38,4 +40,5 @@ services:
- "8005:8000"
volumes:
postgres_data:
static_volunme:
static_volunme:
media_volume:
4 changes: 4 additions & 0 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,9 @@ server {
# static file servce
alias /home/app/web/static/;
}

location /media/ {
alias /home/app/web/media/;
}

}

0 comments on commit 3e93f46

Please sign in to comment.