Files
ECShopX_docker/php74/docker-compose.yml
2025-12-29 22:29:50 +08:00

82 lines
2.2 KiB
YAML
Executable File
Raw Permalink 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.
services:
ecshopx:
# build:
# context: .
# dockerfile: ./docker-new/Dockerfile
image: shopexhub/php:ecx-7.4.32-fpm-alpine3.16 #这是官方镜像需要自己安装supervisor
#image: wykrisdev/shopex-docker:php74-ECShopX-Open
container_name: ecshopx-api
links:
- mysql
- redis
volumes:
- "./config/php/conf.d/docker-php-ext-opcache.ini:/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini:ro"
# 后端代码:完全绑定挂载(包括 vendor
- "${ECShopX:-./ECShopX}:/data/httpd:cached"
networks:
- webnet
dns: 8.8.8.8
nginx:
image: nginx:latest
container_name: ecshopx-nginx
ports:
- "8080:80" #管理后台
- "8081:81" #移动端
- "8082:82" #PC
links:
- ecshopx
- phpmyadmin
volumes:
- "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro"
# 前端:只挂载 dist 目录,使用 delegated 模式提升性能
- "${ECShopX_ADMIN_FRONTEND:-./ECShopX_admin-frontend}/dist:/data/httpd/ECShopX_admin-frontend/dist:delegated"
- "${ECShopX_DESKTOP_FRONTEND:-./ECShopX_desktop-frontend}/dist:/data/httpd/ECShopX_desktop-frontend/dist:delegated"
- "${ECShopX_MOBILE_FRONTEND:-./ECShopX_mobile-frontend}/dist:/data/httpd/ECShopX_mobile-frontend/dist:delegated"
networks:
- webnet
redis:
image: redis:4.0.14-alpine
command: redis-server --requirepass 123456
container_name: ecshopx-redis
networks:
- webnet
mysql:
image: mysql:8.0
container_name: ecshopx-mysql
ports:
- "33061:3306"
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=ecshopx
volumes:
- mysql74_data:/var/lib/mysql
networks:
- webnet
command: --default-authentication-plugin=mysql_native_password
# 健康检查配置
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
phpmyadmin:
image: phpmyadmin/phpmyadmin:latest
ports:
- "8083:80"
links:
- mysql
environment:
- PMA_HOST=mysql
networks:
- webnet
volumes:
mysql74_data:
driver: local
networks:
webnet:
driver: bridge