mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
167 lines
5.1 KiB
YAML
167 lines
5.1 KiB
YAML
# EDR Platform — application containers only (no Postgres).
|
|
# Requires a local .npmrc with GitHub Packages auth for @tria-plc (freight API + freight web).
|
|
# Copy apps/*/env.example to .env and set real values before `docker compose up`.
|
|
#
|
|
# Build: DOCKER_BUILDKIT=1 docker compose build
|
|
# Run: docker compose up -d
|
|
services:
|
|
# Message broker for payment event delivery (payment-api -> passenger/freight).
|
|
# Management UI: http://localhost:15672 (login edr / edr_secret). vhost: payment.
|
|
# In deployed envs this is a shared/managed RabbitMQ; only PAYMENT_RABBITMQ_URL changes.
|
|
freight-api:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/edr-freight-api/Dockerfile
|
|
secrets:
|
|
- npmrc
|
|
ports:
|
|
- "${FREIGHT_API_PORT:-3001}:${FREIGHT_API_PORT:-3001}"
|
|
env_file:
|
|
- apps/edr-freight-api/.env
|
|
extra_hosts:
|
|
- "paymentcallback.triaplc.com:10.18.7.179"
|
|
|
|
# Standalone GT06 GPS tracker ingester (@edr/gps-tracker). Raw TCP only, no
|
|
# HTTP. Writes freight.gps_devices / freight.gps_positions in the shared
|
|
# freight DB; the /gps REST API stays in freight-api. Never runs migrations.
|
|
gps-tracker:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/edr-gps-tracker/Dockerfile
|
|
secrets:
|
|
- npmrc
|
|
depends_on:
|
|
- freight-api
|
|
ports:
|
|
# Raw TCP — reachable by tracker SIMs. Not HTTP; no L7 proxy can host-route it.
|
|
- "${GT06_TCP_PORT:-5023}:5023"
|
|
environment:
|
|
GT06_TCP_PORT: "5023"
|
|
GT06_TCP_HOST: "0.0.0.0"
|
|
env_file:
|
|
# Reuses the freight DB credentials (DB_HOST/DB_PORT/DB_USER/DB_PASSWORD/DB_NAME).
|
|
- apps/edr-freight-api/.env
|
|
restart: unless-stopped
|
|
|
|
passenger-api:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/edr-passenger-api/Dockerfile
|
|
ports:
|
|
- "${PASSENGER_API_PORT:-4000}:${PASSENGER_API_PORT:-4000}"
|
|
env_file:
|
|
- apps/edr-passenger-api/.env
|
|
extra_hosts:
|
|
- "paymentcallback.triaplc.com:10.18.7.179"
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:4000/health/ready"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '1.0'
|
|
memory: 1G
|
|
freight-portal:
|
|
build:
|
|
context: .
|
|
dockerfile: infrastructure/docker/Dockerfile.web
|
|
args:
|
|
TURBO_FILTER: "@edr/freight-portal"
|
|
APP_PATH: apps/edr-freight-web/portal
|
|
VITE_API_URL: ${VITE_API_URL:-}
|
|
VITE_BASE_API_URL: ${VITE_BASE_API_URL:-}
|
|
VITE_USER_MANAGEMENT_BASE: ${VITE_USER_MANAGEMENT_BASE:-}
|
|
VITE_GOOGLE_MAPS_API_KEY: ${VITE_GOOGLE_MAPS_API_KEY:-}
|
|
secrets:
|
|
- npmrc
|
|
ports:
|
|
- "${FREIGHT_PORTAL_PORT:-5173}:80"
|
|
freight-backoffice:
|
|
build:
|
|
context: .
|
|
dockerfile: infrastructure/docker/Dockerfile.web
|
|
args:
|
|
TURBO_FILTER: "@edr/freight-backoffice"
|
|
APP_PATH: apps/edr-freight-web/backoffice
|
|
VITE_API_URL: ${VITE_API_URL:-}
|
|
VITE_BASE_API_URL: ${VITE_BASE_API_URL:-}
|
|
VITE_USER_MANAGEMENT_BASE: ${VITE_USER_MANAGEMENT_BASE:-}
|
|
VITE_GOOGLE_MAPS_API_KEY: ${VITE_GOOGLE_MAPS_API_KEY:-}
|
|
secrets:
|
|
- npmrc
|
|
ports:
|
|
- "${FREIGHT_BACKOFFICE_PORT:-5183}:80"
|
|
passenger-portal:
|
|
build:
|
|
context: .
|
|
dockerfile: infrastructure/docker/Dockerfile.passenger-web
|
|
args:
|
|
APP_PACKAGE: "@edr/passenger-portal"
|
|
APP_PATH: apps/edr-passenger-web/portal
|
|
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-}
|
|
secrets:
|
|
- npmrc
|
|
ports:
|
|
- "${PASSENGER_PORTAL_PORT:-5174}:${PASSENGER_PORTAL_PORT:-5174}"
|
|
env_file:
|
|
- apps/edr-passenger-web/portal/.env
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:${PASSENGER_PORTAL_PORT:-5174}/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '0.5'
|
|
memory: 512M
|
|
passenger-backoffice:
|
|
build:
|
|
context: .
|
|
dockerfile: infrastructure/docker/Dockerfile.passenger-web
|
|
args:
|
|
APP_PACKAGE: "@edr/passenger-backoffice"
|
|
APP_PATH: apps/edr-passenger-web/backoffice
|
|
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-}
|
|
secrets:
|
|
- npmrc
|
|
ports:
|
|
- "${PASSENGER_BACKOFFICE_PORT:-5184}:${PASSENGER_BACKOFFICE_PORT:-5184}"
|
|
env_file:
|
|
- apps/edr-passenger-web/backoffice/.env
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:${PASSENGER_BACKOFFICE_PORT:-5184}/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '0.5'
|
|
memory: 512M
|
|
|
|
payment-api:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/edr-payment-api/Dockerfile
|
|
args:
|
|
APP_PACKAGE: "@edr/payment-api"
|
|
APP_PATH: apps/edr-payment-api
|
|
secrets:
|
|
- npmrc
|
|
ports:
|
|
- "${PAYMENT_API_PORT:-3008}:${PAYMENT_API_PORT:-3008}"
|
|
env_file:
|
|
- apps/edr-payment-api/.env
|
|
secrets:
|
|
npmrc:
|
|
file: .npmrc
|