Add start-test.bat for an isolated Docker test stand
Runs a separate compose project (pgames-test) on port 8090 with its own .env.test and data-test/, starts Docker Desktop if needed and generates a sample game to upload. env_file in compose is now overridable via ENV_FILE. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
364b312064
commit
35033fb86c
4 files changed
+154
-58
No files matched your search
+58
-58
@@ -1,58 +1,58 @@
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: pgames
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pgames}
|
||||
POSTGRES_DB: pgames
|
||||
volumes:
|
||||
- db:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U pgames"]
|
||||
interval: 5s
|
||||
retries: 20
|
||||
|
||||
backend:
|
||||
build: ./backend
|
||||
restart: unless-stopped
|
||||
env_file: .env
|
||||
environment:
|
||||
DATABASE_URL: postgresql+asyncpg://pgames:${POSTGRES_PASSWORD:-pgames}@db:5432/pgames
|
||||
DATA_DIR: /data
|
||||
volumes:
|
||||
- ${DATA_PATH:-./data}:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"]
|
||||
interval: 5s
|
||||
retries: 30
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
worker:
|
||||
build: ./backend
|
||||
restart: unless-stopped
|
||||
command: ["python", "-m", "app.worker"]
|
||||
env_file: .env
|
||||
environment:
|
||||
DATABASE_URL: postgresql+asyncpg://pgames:${POSTGRES_PASSWORD:-pgames}@db:5432/pgames
|
||||
DATA_DIR: /data
|
||||
volumes:
|
||||
- ${DATA_PATH:-./data}:/data
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy # migrations are applied by backend
|
||||
|
||||
web:
|
||||
build: ./frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${HTTP_PORT:-8080}:80"
|
||||
volumes:
|
||||
- ${DATA_PATH:-./data}:/data:ro
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
volumes:
|
||||
db:
|
||||
services:
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_USER: pgames
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pgames}
|
||||
POSTGRES_DB: pgames
|
||||
volumes:
|
||||
- db:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U pgames"]
|
||||
interval: 5s
|
||||
retries: 20
|
||||
|
||||
backend:
|
||||
build: ./backend
|
||||
restart: unless-stopped
|
||||
env_file: ${ENV_FILE:-.env}
|
||||
environment:
|
||||
DATABASE_URL: postgresql+asyncpg://pgames:${POSTGRES_PASSWORD:-pgames}@db:5432/pgames
|
||||
DATA_DIR: /data
|
||||
volumes:
|
||||
- ${DATA_PATH:-./data}:/data
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')"]
|
||||
interval: 5s
|
||||
retries: 30
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
worker:
|
||||
build: ./backend
|
||||
restart: unless-stopped
|
||||
command: ["python", "-m", "app.worker"]
|
||||
env_file: ${ENV_FILE:-.env}
|
||||
environment:
|
||||
DATABASE_URL: postgresql+asyncpg://pgames:${POSTGRES_PASSWORD:-pgames}@db:5432/pgames
|
||||
DATA_DIR: /data
|
||||
volumes:
|
||||
- ${DATA_PATH:-./data}:/data
|
||||
depends_on:
|
||||
backend:
|
||||
condition: service_healthy # migrations are applied by backend
|
||||
|
||||
web:
|
||||
build: ./frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${HTTP_PORT:-8080}:80"
|
||||
volumes:
|
||||
- ${DATA_PATH:-./data}:/data:ro
|
||||
depends_on:
|
||||
- backend
|
||||
|
||||
volumes:
|
||||
db:
|
||||
Reference in new issue
Block a user