添加LOTTERY_E2E环境变量来控制E2E测试相关功能, 包括绕过验证码、登录限制和钱包API URL验证, 同时更新composer.json以包含E2E专用的提供者和服务。
This commit is contained in:
55
e2e/docker-compose.yml
Normal file
55
e2e/docker-compose.yml
Normal file
@@ -0,0 +1,55 @@
|
||||
name: lotterlaravel-e2e
|
||||
|
||||
# e2e 测试专用:只起后端依赖(Postgres + Redis)。
|
||||
# Laravel 应用本身由 `e2e/scripts/run.sh` 在宿主机上以 `php artisan serve` 拉起,
|
||||
# 这样保留与生产一致的 PHP-FPM / OPCache / .env 加载路径,也避免在容器里
|
||||
# 重新装一遍 vendor。容器只在需要数据库与缓存时使用。
|
||||
#
|
||||
# 使用方法(在仓库根):
|
||||
# docker compose -f e2e/docker-compose.yml up -d
|
||||
# ./e2e/scripts/run.sh
|
||||
# docker compose -f e2e/docker-compose.yml down -v
|
||||
#
|
||||
# macOS 用户:OrbStack / Colima / Docker Desktop 任一即可。
|
||||
# Apple Silicon 警告:postgis/postgis 镜像仅支持 amd64;用 postgres:16-alpine 即可。
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: lotterlaravel-e2e-pg
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: lottery
|
||||
POSTGRES_PASSWORD: lottery
|
||||
POSTGRES_DB: lottery_e2e
|
||||
ports:
|
||||
- "15432:5432"
|
||||
volumes:
|
||||
- lotterlaravel-e2e-pg:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U lottery -d lottery_e2e"]
|
||||
interval: 2s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
container_name: lotterlaravel-e2e-redis
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "16379:6379"
|
||||
command:
|
||||
- redis-server
|
||||
- --save
|
||||
- ""
|
||||
- --appendonly
|
||||
- "no"
|
||||
# e2e 跑完即清,不做持久化(启动更快,状态可重现)
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 2s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
|
||||
volumes:
|
||||
lotterlaravel-e2e-pg:
|
||||
Reference in New Issue
Block a user