-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
71 lines (67 loc) · 1.64 KB
/
docker-compose.yaml
File metadata and controls
71 lines (67 loc) · 1.64 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
# 干净的 docker-compose.yaml (无非法字符)
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: go-basic-arch-app
ports:
- "9922:9922"
volumes:
- ./config/config.prod.yaml:/app/config/config.prod.yaml:ro
- ./config/config.dev.yaml:/app/config/config.dev.yaml:ro
- ./logs/server:/app/logs/server
environment:
- APP_ENV=dev
- GIN_MODE=release
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
networks:
- app-network
restart: unless-stopped
redis:
image: redis:6.2-alpine
container_name: go-basic-arch-redis
ports:
- "6379:6379"
volumes:
- redis-data:/data
networks:
- app-network
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
db:
image: mysql:8.0
container_name: go-basic-arch-db
environment:
MYSQL_ROOT_PASSWORD: "0220059cyCY"
MYSQL_DATABASE: "lionchat_base"
MYSQL_USER: "lionchat_user" # <-- 添加此行
MYSQL_PASSWORD: "lionchat_password"
ports:
- "3306:3306"
volumes:
- db-data:/var/lib/mysql
networks:
- app-network
restart: unless-stopped
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-u", "root", "-p0220059cyCY"]
interval: 10s
timeout: 5s
retries: 10
volumes:
redis-data:
driver: local
db-data:
driver: local
networks:
app-network:
driver: bridge