62 lines
1.3 KiB
YAML
62 lines
1.3 KiB
YAML
version: "3.9"
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:15
|
|
environment:
|
|
POSTGRES_DB: skymoney
|
|
POSTGRES_USER: app
|
|
POSTGRES_PASSWORD: app
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U app -d skymoney"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
|
|
api:
|
|
build:
|
|
context: ./api
|
|
dockerfile: Dockerfile
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: "8080"
|
|
DATABASE_URL: postgres://app:app@postgres:5432/skymoney
|
|
CORS_ORIGIN: http://localhost:5173
|
|
|
|
depends_on:
|
|
- postgres
|
|
ports:
|
|
- "8081:8080"
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
# runs *inside* the container; port 8080 is the app's internal port
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:8080/health || exit 1"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 10s
|
|
|
|
caddy:
|
|
image: caddy:2
|
|
ports:
|
|
- "8080:80"
|
|
volumes:
|
|
- ./Caddyfile.dev:/etc/caddy/Caddyfile:ro
|
|
- ./web/dist:/srv/site:ro
|
|
depends_on:
|
|
- api
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost/ || exit 1"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 10
|
|
|
|
volumes:
|
|
pgdata:
|