64 lines
2.0 KiB
YAML
64 lines
2.0 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:18
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 12
|
|
restart: unless-stopped
|
|
|
|
cloud-api:
|
|
build:
|
|
context: .
|
|
command:
|
|
- sh
|
|
- -c
|
|
- >-
|
|
alembic -c packages/cloud-platform/cloud/migrations/alembic.ini upgrade head
|
|
&& exec device-cloud-api --host 0.0.0.0 --port 8001
|
|
environment:
|
|
CLOUD_ENVIRONMENT: production
|
|
CLOUD_DATABASE_URL: postgresql+psycopg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
|
CLOUD_TRUST_PROXY_HEADERS: ${CLOUD_TRUST_PROXY_HEADERS:-false}
|
|
CLOUD_LLM_PROVIDER_ENCRYPTION_KEY: ${CLOUD_LLM_PROVIDER_ENCRYPTION_KEY}
|
|
ports:
|
|
- "${CLOUD_API_PORT:-8001}:8001"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:8001/health/ready"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 12
|
|
restart: unless-stopped
|
|
|
|
# Before the first `docker compose up`, create the one-time local operator
|
|
# account interactively: `docker compose run --rm host-agent device-host-agent setup`.
|
|
# The daemon's default command below has no TTY and fails fast if that
|
|
# account does not already exist under HOST_AGENT_LOCAL_ACCOUNT_PATH.
|
|
host-agent:
|
|
build:
|
|
context: .
|
|
command: ["device-host-agent"]
|
|
environment:
|
|
HOST_AGENT_CONTROL_PLANE_URL: http://cloud-api:8001
|
|
HOST_AGENT_IDENTITY_PATH: ${HOST_AGENT_IDENTITY_PATH:-/app/tasks/host_identity.json}
|
|
HOST_AGENT_LOCAL_ACCOUNT_PATH: ${HOST_AGENT_LOCAL_ACCOUNT_PATH:-/app/tasks/host_local_account.json}
|
|
volumes:
|
|
- ${HOST_AGENT_TASKS_PATH:-./tasks}:/app/tasks
|
|
depends_on:
|
|
cloud-api:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
postgres-data:
|