-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
37 lines (33 loc) · 1.11 KB
/
docker-compose.yml
File metadata and controls
37 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
version: "3.8"
services:
app:
build: .
command: gunicorn tripproject.wsgi:application --bind 0.0.0.0:8000
volumes:
- .:/app
- ./staticfiles:/app/staticfiles
expose:
- 8000
nginx:
build:
context: ./nginx # Or '.' if your Dockerfile is in the project root
dockerfile: Dockerfile # Only needed if your Dockerfile has a non-standard name
volumes:
- ./staticfiles:/app/staticfiles
- /etc/letsencrypt:/etc/nginx/certs # Updated path
ports:
- "80:80"
- "443:443" # Open port 443 for HTTPS
depends_on:
- app
certbot:
image: certbot/certbot
volumes:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
- ./staticfiles:/var/www/html # Ensure this path is served by Nginx and accessible for the challenge
- ./reload-nginx.sh:/etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew --deploy-hook \"/etc/letsencrypt/renewal-hooks/deploy/reload-nginx.sh\"; sleep 12h & wait $${!}; done;'"
volumes:
certbot-etc:
certbot-var: