43 lines
1.1 KiB
YAML
43 lines
1.1 KiB
YAML
|
|
services:
|
||
|
|
api:
|
||
|
|
build:
|
||
|
|
context: ./api
|
||
|
|
dockerfile: Dockerfile
|
||
|
|
container_name: fquiz-api
|
||
|
|
environment:
|
||
|
|
API_HOST: ${API_HOST:-0.0.0.0}
|
||
|
|
API_PORT: ${API_PORT:-8000}
|
||
|
|
API_CORS_ORIGINS: ${API_CORS_ORIGINS:-http://localhost:3000,http://127.0.0.1:3000}
|
||
|
|
ports:
|
||
|
|
- "${API_PORT:-8000}:8000"
|
||
|
|
healthcheck:
|
||
|
|
test:
|
||
|
|
[
|
||
|
|
"CMD",
|
||
|
|
"python",
|
||
|
|
"-c",
|
||
|
|
"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=2).read()",
|
||
|
|
]
|
||
|
|
interval: 10s
|
||
|
|
timeout: 3s
|
||
|
|
retries: 5
|
||
|
|
start_period: 10s
|
||
|
|
restart: unless-stopped
|
||
|
|
|
||
|
|
web:
|
||
|
|
build:
|
||
|
|
context: ./web
|
||
|
|
dockerfile: Dockerfile
|
||
|
|
args:
|
||
|
|
NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL:-http://localhost:8000}
|
||
|
|
container_name: fquiz-web
|
||
|
|
depends_on:
|
||
|
|
api:
|
||
|
|
condition: service_healthy
|
||
|
|
environment:
|
||
|
|
NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL:-http://localhost:8000}
|
||
|
|
NODE_ENV: production
|
||
|
|
ports:
|
||
|
|
- "3000:3000"
|
||
|
|
restart: unless-stopped
|