-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
70 lines (63 loc) · 1.36 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
version: "3"
services:
mysql:
container_name: mysql
image: mysql:8.1.0
ports:
- "3306:3306"
networks:
- towork-api-network
restart: unless-stopped
volumes:
- mysql_data:/var/lib/mysql
environment:
TZ: Asia/Seoul"
MYSQL_USER: ${MYSQL_USERNAME}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_RANDOM_ROOT_PASSWORD: yes
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
interval: 5s
timeout: 3s
retries: 10
redis:
container_name: redis
image: redis:7.2.0-alpine
ports:
- "6379:6379"
networks:
- towork-api-network
restart: unless-stopped
volumes:
- redis_data:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli ping | grep PONG"]
interval: 5s
timeout: 3s
retries: 10
spring:
container_name: spring
build:
context: .
dockerfile: ./Dockerfile
image: hsukju00/towork-api
env_file:
- .env
ports:
- "8080:8080"
networks:
- towork-api-network
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
networks:
towork-api-network:
volumes:
mysql_data:
redis_data: