-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (55 loc) · 1.33 KB
/
docker-compose.yml
File metadata and controls
59 lines (55 loc) · 1.33 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
version: '3.8'
services:
transbridge:
build:
context: .
dockerfile: Dockerfile
args:
BUILD_VERSION: ${BUILD_VERSION:-dev}
BUILD_DATE: ${BUILD_DATE:-unknown}
COMMIT_HASH: ${COMMIT_HASH:-unknown}
image: transbridge:${TAG:-latest}
container_name: transbridge
restart: unless-stopped
ports:
- "${PORT:-8080}:8080"
volumes:
- ${CONFIG_FILE:-./config.yml}:/app/config.yml
- ${LOGS_DIR:-./logs}:/app/logs
environment:
- TZ=Asia/Shanghai
depends_on:
- redis
networks:
- transbridge-network
# 健康检查
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8080/health"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
# Redis 缓存服务 (可选,如果不需要可以注释掉)
redis:
image: redis:alpine
container_name: transbridge-redis
restart: unless-stopped
ports:
- "127.0.0.1:${REDIS_PORT:-6379}:6379"
volumes:
- redis-data:/data
networks:
- transbridge-network
command: redis-server --appendonly yes
# 健康检查
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 5s
retries: 3
networks:
transbridge-network:
driver: bridge
volumes:
redis-data:
driver: local