Files
Ehsan/docker-compose.yml
T

46 lines
1.2 KiB
YAML
Raw Normal View History

# Docker Compose for the EHSAN app on the Mac Mini.
#
# Two services:
# - api : Express API server (internal only, reached via the web proxy)
# - web : nginx serving the built SPA + reverse-proxying /api -> api
#
# Platform is pinned to linux/amd64 because the workspace strips all native
# binaries that are not linux-x64-gnu. On Apple Silicon this runs under
# emulation/Rosetta automatically.
services:
api:
build:
context: .
dockerfile: Dockerfile.api
platform: linux/amd64
environment:
NODE_ENV: production
PORT: "8080"
expose:
- "8080"
restart: unless-stopped
healthcheck:
test:
- CMD
- node
- -e
- "fetch('http://localhost:8080/api/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
interval: 30s
timeout: 5s
retries: 5
start_period: 20s
web:
build:
context: .
dockerfile: Dockerfile.web
platform: linux/amd64
ports:
# Host port is configurable: WEB_PORT (default 8080) -> container :80
- "${WEB_PORT:-8080}:80"
depends_on:
api:
condition: service_healthy
restart: unless-stopped