-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
97 lines (92 loc) · 2.24 KB
/
docker-compose.yml
File metadata and controls
97 lines (92 loc) · 2.24 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
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
95
96
97
services:
api:
build:
context: .
dockerfile: Dockerfile
container_name: api
ports:
- '3001:3001'
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
mongodb:
condition: service_started
redis:
condition: service_started
env_file:
- .env
networks:
- app-network
nginx:
image: nginx:latest
container_name: nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx:/etc/nginx/conf.d
- /etc/letsencrypt/live/${DOMAIN}:/etc/letsencrypt/live/${DOMAIN}
- /etc/letsencrypt/archive/${DOMAIN}:/etc/letsencrypt/archive/${DOMAIN}
depends_on:
- api
networks:
- app-network
mysql:
image: mysql:8.0
container_name: mysql
ports:
- '3306:3306'
restart: unless-stopped
env_file:
- .env
volumes:
- mysql_data:/var/lib/mysql
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- app-network
healthcheck:
test:
[
'CMD',
'mysqladmin',
'ping',
'-h',
'localhost',
'-u$$MYSQL_USER',
'-p$$MYSQL_PASSWORD',
]
interval: 5s
timeout: 5s
retries: 10
mongodb:
image: mongo:6.0
container_name: mongodb
restart: unless-stopped
ports:
- "27017:27017"
env_file:
- .env
volumes:
- mongo_data:/data/db
networks:
- app-network
redis:
image: redis:alpine
container_name: redis
restart: unless-stopped
ports:
- "6379:6379"
env_file:
- .env
volumes:
- redis_data:/data
networks:
- app-network
networks:
app-network:
volumes:
mysql_data:
mongo_data:
redis_data: