chore: use test host database and redis in dev compose

This commit is contained in:
hajimi
2026-08-01 17:09:24 +08:00
parent 40619e2335
commit b4c212f68f
5 changed files with 43 additions and 50 deletions
+6 -49
View File
@@ -11,13 +11,11 @@ services:
<<: *php-image
working_dir: /likeadmin_php/server
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ../server:/likeadmin_php/server
- ./.env.server:/likeadmin_php/server/.env:ro
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- sport-era-dev
@@ -25,15 +23,13 @@ services:
<<: *php-image
working_dir: /likeadmin_php/server
restart: unless-stopped
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
command: >-
sh -c "while true; do php think crontab; sleep 60; done"
volumes:
- ../server:/likeadmin_php/server
- ./.env.server:/likeadmin_php/server/.env:ro
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- sport-era-dev
@@ -85,45 +81,6 @@ services:
networks:
- sport-era-dev
mysql:
image: mysql:8.2
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${SPORT_ERA_MYSQL_ROOT_PASSWORD:-root}
MYSQL_DATABASE: ${SPORT_ERA_MYSQL_DATABASE:-sbnews}
MYSQL_USER: ${SPORT_ERA_MYSQL_USER:-sbnews}
MYSQL_PASSWORD: ${SPORT_ERA_MYSQL_PASSWORD:-sbnews}
TZ: Asia/Shanghai
ports:
- "${SPORT_ERA_MYSQL_PORT:-3307}:3306"
volumes:
- ./data/mysql:/var/lib/mysql
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p$$MYSQL_ROOT_PASSWORD --silent"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
- sport-era-dev
redis:
image: registry.cn-guangzhou.aliyuncs.com/likeadmin/redis:7.4.0
restart: unless-stopped
command: redis-server --appendonly yes
ports:
- "${SPORT_ERA_REDIS_PORT:-6379}:6379"
volumes:
- ./data/redis:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
start_period: 10s
networks:
- sport-era-dev
volumes:
admin-node-modules:
uniapp-node-modules: