Files
eleith eeaa386853
ci/woodpecker/pr/config Pipeline was successful
ci/woodpecker/pr/web Pipeline was successful
ci/woodpecker/pr/worker Pipeline was successful
ci/woodpecker/push/config Pipeline was successful
ci/woodpecker/push/web Pipeline was successful
ci/woodpecker/push/worker Pipeline was successful
fix(web): align trusted-proxy request handling
2026-11-04 09:27:14 -08:00

102 lines
2.7 KiB
YAML

name: hledger-web-reports
# Keep the upstream private; the trusted proxy supplies public request metadata.
# Local Vite development uses docker-compose.dev.yml instead.
services:
web:
build:
context: ../..
dockerfile: apps/web/Dockerfile
target: prod
platform: linux/amd64
network_mode: host
environment:
CONFIG_PATH: /app/config/hledger-reports.yaml
APP_URL: ${APP_URL:-http://127.0.0.1:3000}
AUTH_SECRET: ${AUTH_SECRET:-}
AUTH_PASSWORD: ${AUTH_PASSWORD:-}
OIDC_CLIENT_SECRET: ${OIDC_CLIENT_SECRET:-}
HOST: 127.0.0.1
PORT: '3000'
PROTOCOL_HEADER: x-forwarded-proto
ADDRESS_HEADER: x-real-ip
volumes:
- type: bind
source: ./config/hledger-reports.yaml
target: /app/config/hledger-reports.yaml
read_only: true
bind:
create_host_path: false
- ./data:/app/data
# Saved reports remain readable while the worker is starting or unavailable.
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://127.0.0.1:3000/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
]
interval: 5s
timeout: 3s
start_period: 20s
retries: 12
worker:
build:
context: ../..
dockerfile: apps/worker/Dockerfile
target: prod
platform: linux/amd64
network_mode: host
environment:
CONFIG_PATH: /app/config/hledger-reports.yaml
volumes:
- type: bind
source: ./config/hledger-reports.yaml
target: /app/config/hledger-reports.yaml
read_only: true
bind:
create_host_path: false
# Directory binding exposes editor rename-over saves and new include/glob files.
- ${JOURNAL_DIR:-./journals}:/journal:ro
- ./data:/app/data
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://127.0.0.1:9000/healthz').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
]
interval: 5s
timeout: 3s
start_period: 20s
retries: 12
checks:
profiles: [test]
build:
context: ../..
dockerfile: apps/worker/Dockerfile
target: checks
platform: linux/amd64
# Native and HTTP tests need only their own loopback, never the network.
network_mode: none
e2e:
profiles: [test]
build:
context: ../..
dockerfile: apps/web/Dockerfile
target: e2e
platform: linux/amd64
network_mode: host
environment:
PLAYWRIGHT_BASE_URL: http://127.0.0.1:3000
PLAYWRIGHT_USERNAME: ${PLAYWRIGHT_USERNAME:-}
PLAYWRIGHT_PASSWORD: ${PLAYWRIGHT_PASSWORD:-}
depends_on:
web:
condition: service_healthy