Skip to content

Commit

Permalink
nginx!
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmorley15 committed Jul 9, 2024
1 parent 21a935f commit 7b9023d
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
23 changes: 22 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ services:
- DJANGO_ADMIN_USERNAME=admin
- DJANGO_ADMIN_PASSWORD=admin
- [email protected]
- PUBLIC_URL='http://127.0.0.1:8000'
- PUBLIC_URL='http://127.0.0.1:81'
- DEBUG=True
ports:
- "8000:8000"
Expand All @@ -43,6 +43,27 @@ services:
volumes:
- adventurelog_media:/code/media/

nginx:
image: nginx:latest
ports:
- "81:80" # Using port 81 to avoid conflict with your existing setup
volumes:
- adventurelog_media:/app/media
- ./proxy/nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- server

volumes:
postgres_data:
adventurelog_media:
#
# nginx:
# build:
# context: ./proxy/
# dockerfile: Dockerfile.nginx
# ports:
# - "81:80" # Using port 81 to avoid conflict with your existing setup
# volumes:
# - adventurelog_media:/app/media
# depends_on:
# - server
4 changes: 4 additions & 0 deletions proxy/Dockerfile.nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM nginx:alpine

RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d
8 changes: 8 additions & 0 deletions proxy/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
server {
listen 80;
server_name localhost;

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

0 comments on commit 7b9023d

Please sign in to comment.