-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (79 loc) · 1.62 KB
/
Copy pathdocker-compose.yml
File metadata and controls
84 lines (79 loc) · 1.62 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
services:
db:
container_name: db
image: mysql:latest
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: notida
MYSQL_USER: user
MYSQL_PASSWORD: password
ports:
- "3306:3306"
volumes:
- ./mysql/dump.sql:/docker-entrypoint-initdb.d/dump.sql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 10
networks:
- app-network
api:
container_name: api
build:
context: ./api
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
DB_HOST: db
DB_PORT: 3306
DB_USER: user
DB_PASSWORD: password
DB_NAME: notida
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "--fail", "localhost:3000/health"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app-network
client:
container_name: notida
build:
context: ./
dockerfile: Dockerfile
ports:
- "8787:80"
depends_on:
api:
condition: service_healthy
networks:
- app-network
redis:
container_name: redis
image: redis:latest
restart: always
ports:
- "6379:6379"
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "PING"]
interval: 10s
timeout: 5s
retries: 5
networks:
- app-network
volumes:
redis-data:
networks:
app-network:
driver: bridge