Skip to content

Commit

Permalink
Fix deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
JobDoesburg committed Aug 6, 2024
1 parent 0c3a99b commit 7b08de2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 42 deletions.
66 changes: 41 additions & 25 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,47 @@ version: "3"
services:
nginx:
container_name: nginx
image: jwilder/nginx-proxy
image: nginxproxy/nginx-proxy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- ./nginx/html/:/usr/share/nginx/html/
- ./nginx/conf.d/:/etc/nginx/conf.d/
- ./nginx/certs/:/etc/nginx/certs/:ro
- ./nginx/vhost.d/:/etc/nginx/vhost.d/
- ./nginx/dhparam/:/etc/nginx/dhparam/
- ./media/:/landolfio/media/
- ./static/:/landolfio/static/
- ./landolfio.nginx.conf:/etc/nginx/vhost.d/landolfio.vofdoesburg.nl
- nginx-proxy-html:/usr/share/nginx/html/
- nginx-proxy-certs:/etc/nginx/certs/:ro
- nginx-proxy-vhost.d:/etc/nginx/vhost.d/
- ./landolfio.nginx.conf:/etc/nginx/conf.d/landolfio.vofdoesburg.nl.conf:ro
environment:
ENABLE_IPV6: 'true'
TRUST_DOWNSTREAM_PROXY: 'false'
networks:
- web

letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt
image: nginxproxy/acme-companion
restart: unless-stopped
depends_on:
- nginx
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./nginx/html/:/usr/share/nginx/html/
- ./nginx/conf.d/:/etc/nginx/conf.d/
- ./nginx/vhost.d/:/etc/nginx/vhost.d/
- ./nginx/dhparam/:/etc/nginx/dhparam/
- ./nginx/certs/:/etc/nginx/certs/
- nginx-proxy-html:/usr/share/nginx/html/
- nginx-proxy-vhost.d:/etc/nginx/vhost.d/
- nginx-proxy-certs:/etc/nginx/certs/
- nginx-proxy-acme:/etc/acme.sh
environment:
NGINX_PROXY_CONTAINER: 'nginx'
DEFAULT_EMAIL: '[email protected]'
NGINX_PROXY_CONTAINER: nginx
DEFAULT_EMAIL: [email protected]
networks:
- web

database:
image: postgres
restart: unless-stopped
networks:
- db
environment:
- POSTGRES_USER
- POSTGRES_DB
Expand All @@ -48,22 +52,22 @@ services:
- ./postgres_data/:/var/lib/postgresql/data/

web:
image: ghcr.io/jobdoesburg/landolfio:latest
build: .
restart: unless-stopped
networks:
- web
- db
depends_on:
- nginx
- letsencrypt
- database
volumes:
- ./static/:/landolfio/static/
- ./media/:/landolfio/media/
- ./log/:/landolfio/log/
expose:
- 8000
- ./static/:/static/
- django-media:/media/
environment:
- VIRTUAL_HOST=landolfio.vofdoesburg.nl
- VIRTUAL_PORT=8000
- VIRTUAL_PROTO=uwsgi
- VIRTUAL_PORT=80
- VIRTUAL_PROTO=http
- LETSENCRYPT_HOST=landolfio.vofdoesburg.nl
- LANDOLFIO_SECRET_KEY
- LANDOLFIO_ALLOWED_HOSTS
Expand Down Expand Up @@ -95,3 +99,15 @@ services:
- SMTP_FROM_EMAIL
- NOTIFICATION_EMAIL
- PUBLIC_CONTACT_EMAIL

volumes:
nginx-proxy-html:
nginx-proxy-vhost.d:
nginx-proxy-certs:
nginx-proxy-acme:
django-media:

networks:
web:
external: true
db:
17 changes: 0 additions & 17 deletions landolfio.nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,3 @@ uwsgi_read_timeout 300;

client_max_body_size 500M;
client_body_timeout 300s;

location /static/ {
alias /landolfio/static/;
}

location /media/ {
alias /landolfio/media/;
}

location ^~ /.well-known/acme-challenge/ {
auth_basic off;
auth_request off;
allow all;
root /usr/share/nginx/html;
try_files $uri =404;
break;
}

0 comments on commit 7b08de2

Please sign in to comment.