feat: rebuild email platform and operations console
This commit is contained in:
+79
-27
@@ -1,50 +1,101 @@
|
||||
services:
|
||||
# 1. 后端服务 (Node.js + Express + SMTP Server)
|
||||
backend:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/pull-image/email-unlimit-backend:latest
|
||||
build: ./server
|
||||
container_name: email-backend
|
||||
restart: always
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- compose.full.env
|
||||
ports:
|
||||
- "25:25"
|
||||
depends_on:
|
||||
mysql:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-fsS", "http://localhost:3000/health"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
networks:
|
||||
- email-network
|
||||
ports:
|
||||
# - "5182:5182"
|
||||
- "25:25"
|
||||
|
||||
# 2. 数据库服务 (MySQL)
|
||||
mysql:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/pull-image/mysql:8.0
|
||||
image: mysql:8.0
|
||||
container_name: email-mysql
|
||||
restart: always
|
||||
environment:
|
||||
- TZ=Asia/Shanghai
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- compose.full.env
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
volumes:
|
||||
- mysql-data:/var/lib/mysql
|
||||
- ./backend/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"mysqladmin ping -h localhost -p$${MYSQL_ROOT_PASSWORD} --silent",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
networks:
|
||||
- email-network
|
||||
|
||||
# 3. Nginx 反向代理
|
||||
nginx:
|
||||
image: registry.cn-hangzhou.aliyuncs.com/pull-image/nginx:1.21.6
|
||||
container_name: email-nginx
|
||||
restart: always
|
||||
ports:
|
||||
- "80:80" # HTTP
|
||||
- "443:443" # HTTPS (需要SSL证书)
|
||||
redis:
|
||||
image: redis:7.4-alpine
|
||||
container_name: email-redis
|
||||
restart: unless-stopped
|
||||
command: ["redis-server", "--appendonly", "yes"]
|
||||
volumes:
|
||||
- redis-data:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
networks:
|
||||
- email-network
|
||||
|
||||
frontend:
|
||||
build: ./frontend
|
||||
container_name: email-frontend
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- email-network
|
||||
|
||||
admin:
|
||||
build: ./admin
|
||||
container_name: email-admin
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8081:80"
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- email-network
|
||||
|
||||
nginx:
|
||||
image: nginx:1.27-alpine
|
||||
container_name: email-nginx
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
# 挂载前端构建好的静态文件
|
||||
- ./frontend/dist:/usr/share/nginx/html
|
||||
# 挂载 Nginx 配置文件
|
||||
- ./nginx.full.conf:/etc/nginx/nginx.conf:ro
|
||||
# 挂载 SSL 证书
|
||||
- ./certs:/etc/nginx/certs:ro
|
||||
depends_on:
|
||||
- backend
|
||||
- mysql
|
||||
frontend:
|
||||
condition: service_started
|
||||
admin:
|
||||
condition: service_started
|
||||
backend:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- email-network
|
||||
|
||||
@@ -53,4 +104,5 @@ networks:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
mysql-data: {}
|
||||
mysql-data: {}
|
||||
redis-data: {}
|
||||
|
||||
Reference in New Issue
Block a user