81 lines
2.5 KiB
YAML
81 lines
2.5 KiB
YAML
name: krona-staff-pilot
|
|
|
|
services:
|
|
app:
|
|
build:
|
|
context: ../..
|
|
environment:
|
|
NODE_ENV: development
|
|
HOST: 0.0.0.0
|
|
PORT: 8080
|
|
LOG_LEVEL: info
|
|
STAFF_RUNTIME_MODE: standalone
|
|
STANDALONE_ACCESS: employee
|
|
STANDALONE_MANAGER_TOKEN: ${STANDALONE_MANAGER_TOKEN}
|
|
STANDALONE_TERMINAL_TOKEN: ${STANDALONE_TERMINAL_TOKEN}
|
|
STANDALONE_TENANT_ID: ${STANDALONE_TENANT_ID}
|
|
STANDALONE_ACTOR_ID: ${STANDALONE_ACTOR_ID}
|
|
STANDALONE_TERMINAL_ACTOR_ID: ${STANDALONE_TERMINAL_ACTOR_ID}
|
|
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY}
|
|
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY}
|
|
VAPID_SUBJECT: ${VAPID_SUBJECT}
|
|
DATABASE_URL: postgres://krona_staff_app:${POSTGRES_APP_PASSWORD}@postgres:5432/krona_staff
|
|
HTTPS_PFX_PATH: /run/secrets/staff.pfx
|
|
HTTPS_PFX_PASSPHRASE: ${HTTPS_PFX_PASSPHRASE}
|
|
ports:
|
|
- '192.168.1.81:8453:8080'
|
|
volumes:
|
|
- ./secrets/staff.pfx:/run/secrets/staff.pfx:ro
|
|
user: '1000:1000'
|
|
depends_on:
|
|
migrate: { condition: service_completed_successfully }
|
|
restart: unless-stopped
|
|
read_only: true
|
|
tmpfs: [/tmp]
|
|
security_opt: ['no-new-privileges:true']
|
|
healthcheck:
|
|
test: ['CMD-SHELL', 'wget --no-check-certificate -q -O - https://127.0.0.1:8080/api/v1/staff/live || exit 1']
|
|
interval: 30s
|
|
timeout: 3s
|
|
retries: 3
|
|
|
|
db-role:
|
|
build:
|
|
context: ../..
|
|
target: build
|
|
environment:
|
|
DATABASE_MIGRATION_URL: postgres://krona_migrator:${POSTGRES_MIGRATION_PASSWORD}@postgres:5432/krona_staff
|
|
POSTGRES_APP_PASSWORD: ${POSTGRES_APP_PASSWORD}
|
|
command: ['node', 'scripts/create-app-role.mjs']
|
|
depends_on:
|
|
postgres: { condition: service_healthy }
|
|
restart: 'no'
|
|
|
|
migrate:
|
|
build:
|
|
context: ../..
|
|
target: build
|
|
environment:
|
|
DATABASE_MIGRATION_URL: postgres://krona_migrator:${POSTGRES_MIGRATION_PASSWORD}@postgres:5432/krona_staff
|
|
command: ['node', 'scripts/migrate.mjs', 'up']
|
|
depends_on:
|
|
db-role: { condition: service_completed_successfully }
|
|
restart: 'no'
|
|
|
|
postgres:
|
|
image: postgres:17-alpine@sha256:18cfe3ef5e6815560c98237d6216d1e5119702fb0f3894c8785dd58b8bbe5d73
|
|
environment:
|
|
POSTGRES_DB: krona_staff
|
|
POSTGRES_USER: krona_migrator
|
|
POSTGRES_PASSWORD: ${POSTGRES_MIGRATION_PASSWORD}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ['CMD-SHELL', 'pg_isready -U krona_migrator -d krona_staff']
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 20
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres-data:
|