-
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
53 lines (48 loc) · 1.46 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
53 lines (48 loc) · 1.46 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
version: '3.8'
services:
db:
image: mysql:5.7
container_name: reactpress_db
restart: always
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
MYSQL_DATABASE: ${DB_DATABASE:-reactpress}
MYSQL_USER: ${DB_USER:-reactpress}
MYSQL_PASSWORD: ${DB_PASSWD:-reactpress}
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
- --default-authentication-plugin=mysql_native_password
volumes:
- db_data:/var/lib/mysql
networks:
- reactpress-network
# API / 访客站由宿主机 PM2 提供(默认 :3001 / :3002,见 .env 与 scripts/deploy.sh)
# 对外仅暴露 nginx :80;:3000/:3001/:3002 在 nginx 容器内 301 → http://localhost
# Proxies to host PM2 via host.docker.internal:3001 / :3002
nginx:
image: nginx:alpine
container_name: reactpress_nginx
ports:
- "${NGINX_PORT:-80}:80"
- "${WEB_ADMIN_PORT:-3000}:3000"
- "3001:3001"
- "3002:3002"
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./web/dist:/usr/share/reactpress-admin:ro
networks:
- reactpress-network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/health"]
timeout: 10s
retries: 3
start_period: 10s
interval: 30s
volumes:
db_data:
networks:
reactpress-network:
driver: bridge