-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
53 lines (49 loc) · 1.22 KB
/
docker-compose.prod.yml
File metadata and controls
53 lines (49 loc) · 1.22 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
services:
db:
image: postgres:16-alpine
restart: unless-stopped
env_file:
- ./webapp/.env.prod
environment:
POSTGRES_USER: ${POSTGRES_USER:-ppatcher}
POSTGRES_DB: ppatcher
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ppatcher"]
interval: 5s
timeout: 3s
retries: 5
webapp:
build:
context: .
dockerfile: webapp/Dockerfile
restart: unless-stopped
expose:
- "8080"
env_file:
- ./webapp/.env.prod
depends_on:
db:
condition: service_healthy
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./certbot/conf:/etc/letsencrypt:ro
- ./certbot/www:/var/www/certbot:ro
depends_on:
- webapp
certbot:
image: certbot/certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
# Run manually: docker compose -f docker-compose.prod.yml run --rm certbot certonly ...
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done'"
volumes:
pgdata: