generated from UnBArqDsw2023-2/RepositoryTemplate
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
94 lines (87 loc) · 2.29 KB
/
docker-compose.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
version: '3'
volumes:
frontend_build: {}
americanas_production_certbot_www: {}
americanas_production_certbot_conf: {}
services:
backend:
build:
context: ./backend
dockerfile: ./Dockerfile
image: americanas_production_backend
container_name: americanas_production_backend
restart: "always"
environment:
- DJANGO_SETTINGS_MODULE=core.settings.production
# - EXTRA_HTPP_HOSTNAME=backend
env_file:
- ./.envs/production/django
- ./.envs/production/postgres
- ./.envs/production/server_name
networks:
- nginx-access
frontend:
build:
context: ./frontend
dockerfile: ./Dockerfile
image: americanas_production_frontend
container_name: americanas_production_frontend
restart: "no"
environment:
- NODE_OPTIONS="--max-old-space-size=512"
depends_on:
- backend
volumes:
- frontend_build:/frontend/dist:rw
env_file:
- ./.envs/production/server_name
networks:
- nginx-access
nginx:
build:
context: ./nginx
dockerfile: ./Dockerfile
image: americanas_production_nginx
container_name: americanas_production_nginx
restart: "always"
environment:
- FRONTEND_BUILD=/var/www/frontend
depends_on:
- backend
env_file:
- ./.envs/production/server_name
ports:
- '80:80'
- "443:443/tcp"
# - "443:443/udp"
networks:
- nginx-access
volumes:
- frontend_build:/var/www/frontend:ro
- americanas_production_certbot_www:/var/www/certbot/:ro
- americanas_production_certbot_conf:/etc/nginx/ssl/:ro
healthcheck:
test: ps | grep "nginx" | grep "worker process" | grep -v "grep"
interval: 10s
retries: 10
start_period: 3s
timeout: 5s
certbot:
build:
context: ./certbot
dockerfile: ./Dockerfile
image: americanas_production_certbot
container_name: americanas_production_certbot
restart: "always"
depends_on:
nginx:
condition: service_healthy
env_file:
- ./.envs/production/server_name
- ./.envs/production/email
volumes:
- americanas_production_certbot_www:/var/www/certbot/:rw
- americanas_production_certbot_conf:/etc/letsencrypt/:rw
networks:
nginx-access:
driver: bridge