-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
docker-compose-staging.yaml
82 lines (76 loc) · 1.89 KB
/
docker-compose-staging.yaml
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
services:
backend:
container_name: nest-backend
image: arkid15r/owasp-nest-backend:latest
command: >
bash -c "
poetry run python manage.py migrate &&
poetry run python manage.py collectstatic --noinput &&
poetry run gunicorn wsgi:application --bind 0.0.0.0:8000
"
env_file: .env/backend
depends_on:
db:
condition: service_healthy
restart: unless-stopped
networks:
- nest_app_network
- nest_db_network
volumes:
- ./data:/home/owasp/data
frontend:
container_name: nest-frontend
image: arkid15r/owasp-nest-frontend:latest
restart: unless-stopped
networks:
- nest_app_network
certbot:
container_name: nest-certbot
image: certbot/certbot
volumes:
- ./letsencrypt:/etc/letsencrypt
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- certbot-webroot:/var/www/certbot
entrypoint: /bin/sh -c 'trap exit TERM; while :; do certbot renew --webroot -w /var/www/certbot --quiet; sleep 12h & wait $${!}; done;'
db:
container_name: nest-db
image: postgres:16.4
env_file: .env/db
healthcheck:
test:
[
'CMD',
'pg_isready',
'-U',
'nest_user_staging',
'-d',
'nest_db_staging',
]
interval: 5s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
- ./volumes/db:/var/lib/postgresql/data
networks:
- nest_db_network
nginx:
container_name: nest-nginx
image: nginx:latest
ports:
- '80:80'
- '443:443'
volumes:
- ./letsencrypt:/etc/letsencrypt
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- certbot-webroot:/var/www/certbot
depends_on:
- backend
- frontend
networks:
- nest_app_network
networks:
nest_app_network:
nest_db_network:
volumes:
certbot-webroot: