78 lines
2.1 KiB
YAML
78 lines
2.1 KiB
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-miem_workers}
|
|
POSTGRES_USER: ${POSTGRES_USER:-miem}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-miem_password}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-miem} -d ${POSTGRES_DB:-miem_workers}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
api:
|
|
build: .
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
|
|
env_file: .env
|
|
environment:
|
|
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER:-miem}:${POSTGRES_PASSWORD:-miem_password}@postgres:5432/${POSTGRES_DB:-miem_workers}
|
|
ports:
|
|
- "127.0.0.1:8000:8000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
worker:
|
|
build: .
|
|
command: python -m app.worker
|
|
env_file: .env
|
|
environment:
|
|
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER:-miem}:${POSTGRES_PASSWORD:-miem_password}@postgres:5432/${POSTGRES_DB:-miem_workers}
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
mcp:
|
|
build: .
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
|
|
env_file: .env
|
|
environment:
|
|
DATABASE_URL: postgresql+psycopg://${POSTGRES_USER:-miem}:${POSTGRES_PASSWORD:-miem_password}@postgres:5432/${POSTGRES_DB:-miem_workers}
|
|
ports:
|
|
- "127.0.0.1:8001:8000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
keycloak:
|
|
image: quay.io/keycloak/keycloak:latest
|
|
container_name: keycloak
|
|
restart: unless-stopped
|
|
environment:
|
|
KC_DB: postgres
|
|
KC_DB_URL: jdbc:postgresql://postgres:5432/keycloak
|
|
KC_DB_USERNAME: keycloak
|
|
KC_DB_PASSWORD: CHANGE_ME_KEYCLOAK_DB_PASSWORD
|
|
|
|
KEYCLOAK_ADMIN: admin
|
|
KEYCLOAK_ADMIN_PASSWORD: admin-KEYCLOAK-p45sw0rd
|
|
|
|
KC_HTTP_ENABLED: true
|
|
KC_PROXY_HEADERS: xforwarded
|
|
KC_HOSTNAME: https://oauth.miem.space
|
|
|
|
KC_HEALTH_ENABLED: true
|
|
KC_METRICS_ENABLED: true
|
|
command: start
|
|
ports:
|
|
- "127.0.0.1:8080:8080"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
volumes:
|
|
postgres_data:
|