Files
ECShopX/docker-compose.dev.yml
2026-07-20 13:46:08 +08:00

84 lines
2.5 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3.8'
services:
ecshopx-dev:
build:
context: .
dockerfile: docker-dev/Dockerfile
args:
BUILDKIT_INLINE_CACHE: 1
NODE_DIST_BASE: https://npmmirror.com/mirrors/node
image: ecshopx-dev
container_name: ecshopx-dev
restart: unless-stopped
ports:
- "${ADMIN_HOST_PORT:-8080}:8080" # Nginx 管理后台/API
- "${H5_HOST_PORT:-8081}:8081" # Nginx H5 前端服务
- "${PC_HOST_PORT:-8082}:8082" # Nginx PC 前端代理
volumes:
# 挂载目录
- ..:/data/httpd
# 数据持久化
- mysql_data:/var/lib/mysql
- redis_data:/var/lib/redis
environment:
# PHP-FPM 配置
- FPM_LISTEN=127.0.0.1:9000
- FPM_PM=dynamic
- FPM_PM_MAX_CHILDREN=40
- FPM_PM_MIN_SPARE_SERVERS=5
- FPM_PM_MAX_SPARE_SERVERS=10
- FPM_PHP_ADMIN_VALUE_MEMORY_LIMIT=128M
# MySQL 配置
- MYSQL_ROOT_PASSWORD=rootpassword
- MYSQL_DATABASE=ecshopx
- MYSQL_USER=ecshopx
- MYSQL_PASSWORD=ecshopx
# Redis 配置
- REDIS_PASSWORD=redispassword
# 应用配置(会写入 .env
- DB_HOST=127.0.0.1
- DB_PORT=3306
- DB_DATABASE=ecshopx
- DB_USERNAME=ecshopx
- DB_PASSWORD=ecshopx
- REDIS_HOST=127.0.0.1
- REDIS_PORT=6379
- REDIS_DATABASE=0
# 时区
- TZ=Asia/Shanghai
networks:
- ecshopx-dev-network
ecshopx-web-frontend:
image: node:20.19.0-alpine
container_name: ecshopx-web-frontend
restart: unless-stopped
working_dir: /data/httpd/ECShopX_web-frontend
command: sh /data/httpd/ECShopX/docker-dev/web-entrypoint.sh
volumes:
- ..:/data/httpd
environment:
- TZ=Asia/Shanghai
- NUXT_WAIT_INTERVAL=10
# SSR 走容器内网访问 API不影响管理后台
- NUXT_API_BASE=http://ecshopx-dev:8080/api/h5app
- NUXT_INTERNAL_API_BASE=http://ecshopx-dev:8080/api/h5app
# 浏览器侧请求使用外部可访问地址dev-setup.sh 会按安装配置传入
- NUXT_PUBLIC_API_BASE=${NUXT_PUBLIC_API_BASE:-http://localhost:8080/api/h5app}
# PC 装修预览允许接收的后台 origindev-setup.sh 会按管理后台地址传入
- NUXT_PUBLIC_DECORATION_ADMIN_ORIGINS=${NUXT_PUBLIC_DECORATION_ADMIN_ORIGINS:-http://localhost:8080}
networks:
- ecshopx-dev-network
volumes:
mysql_data:
name: ecshopx-dev-mysql
redis_data:
name: ecshopx-dev-redis
networks:
ecshopx-dev-network:
name: ecshopx-dev-net
driver: bridge