-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
54 lines (50 loc) · 1.19 KB
/
Copy pathdocker-compose.yml
File metadata and controls
54 lines (50 loc) · 1.19 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
version: "3.9"
services:
mysql:
image: mysql:8.0
container_name: gin-admin-api-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: "123456"
MYSQL_DATABASE: "gin-admin-api"
MYSQL_CHARSET: "utf8mb4"
ports:
- "3307:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./gin-admin-api.sql:/docker-entrypoint-initdb.d/init.sql
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --default-time-zone=+08:00
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p123456"]
interval: 5s
timeout: 3s
retries: 10
redis:
image: redis:7-alpine
container_name: gin-admin-api-redis
restart: unless-stopped
ports:
- "6380:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
app:
build: .
container_name: gin-admin-api-app
restart: unless-stopped
ports:
- "8000:8000"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./logs:/app/logs
volumes:
mysql_data: