-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
63 lines (59 loc) · 1.4 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
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- '3000:3000'
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
environment:
- DB_MYSQL_HOST=mysql
- DB_MYSQL_PORT=3306
- DB_MYSQL_USERNAME=root
- DB_MYSQL_PASSWORD=${DB_MYSQL_PASSWORD}
- DB_MYSQL_DATABASE=${DB_MYSQL_DATABASE}
- REDIS_HOST=redis
- REDIS_PORT=6379
volumes:
- .:/usr/src/app
mysql:
image: mysql:8.0
ports:
- ${DB_MYSQL_PORT}:3306
environment:
- MYSQL_ROOT_PASSWORD=${DB_MYSQL_PASSWORD}
- MYSQL_DATABASE=${DB_MYSQL_DATABASE}
volumes:
- ./mysql:/docker-entrypoint-initdb.d
- mysql_data:/var/lib/mysql
command:
- --connect-timeout=31536000
- --net_write_timeout=600
- --max_allowed_packet=16M
- --collation-server=utf8mb4_general_ci
- --default-time-zone=${DB_MYSQL_TIMEZONE}
- --character-set-server=${DB_MYSQL_CHARSET}
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7.0
ports:
- ${REDIS_PORT}:6379
volumes:
- redis_data:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 5s
retries: 5
volumes:
mysql_data:
redis_data: