-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompose.yaml
More file actions
88 lines (83 loc) · 2.55 KB
/
compose.yaml
File metadata and controls
88 lines (83 loc) · 2.55 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
85
86
87
88
name: helios-middleware
services:
db:
image: mysql:8.0
container_name: helios-db
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_USER: ${MYSQL_USER:-helios}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-helios}
volumes:
- helios_mysql_data:/var/lib/mysql
- helios_mysql_logs:/var/log/mysql
# 挂载 SQL 初始化文件
- ./sql/hermes/schema.sql:/docker-entrypoint-initdb.d/01-hermes-schema.sql:ro
- ./sql/hermes/init.sql:/docker-entrypoint-initdb.d/02-hermes-init.sql:ro
- ./sql/zwei/schema.sql:/docker-entrypoint-initdb.d/03-zwei-schema.sql:ro
- ./sql/zwei/init.sql:/docker-entrypoint-initdb.d/04-zwei-init.sql:ro
# 挂载 MySQL 配置
- ./environments/db/my.cnf:/etc/mysql/conf.d/custom.cnf:ro
restart: unless-stopped
deploy:
resources:
limits:
memory: 450m
cpus: "1.5"
cache:
image: redis:7-alpine
container_name: helios-cache
ports:
- "6379:6379"
volumes:
- helios_redis_data:/data
# 挂载 Redis 配置
- ./environments/cache/redis.conf:/usr/local/etc/redis/redis.conf:ro
command: redis-server /usr/local/etc/redis/redis.conf
restart: unless-stopped
deploy:
resources:
limits:
memory: 512m
cpus: "0.5"
gateway:
image: nginx:alpine
container_name: helios-gateway
# 本地开发默认 HTTPS 模式:gateway 不映射主机端口 80,只暴露给容器内部
# https-proxy 会监听主机端口 80 和 443,转发到 gateway:80
# 生产环境:通过 compose.prod.yaml 覆盖,正常映射主机端口 80,不使用 https-proxy
ports: []
volumes:
# 挂载 Nginx 配置
- ./environments/gateway/nginx.conf:/etc/nginx/nginx.conf:ro
extra_hosts:
- "host.docker.internal:host-gateway"
restart: unless-stopped
deploy:
resources:
limits:
memory: 128m
cpus: "0.25"
stop_grace_period: 10s
https-proxy:
# 本地开发 HTTPS 模式:监听主机端口 80 和 443,转发到 gateway:80
image: nginx:alpine
container_name: helios-https-proxy
ports:
- "443:443"
- "80:80"
volumes:
- ./environments/https-proxy/nginx.conf:/etc/nginx/nginx.conf:ro
- ./environments/certs:/etc/nginx/ssl:ro
restart: unless-stopped
deploy:
resources:
limits:
memory: 64m
cpus: "0.1"
stop_grace_period: 10s
volumes:
helios_redis_data:
helios_mysql_data:
helios_mysql_logs: