diff --git a/docker-compose.lda.yml b/docker-compose.lda.yml new file mode 100644 index 0000000..5d4b055 --- /dev/null +++ b/docker-compose.lda.yml @@ -0,0 +1,58 @@ +x-luminus-dynamic-api: &x-luminus-dynamic-api + build: + context: ./luminus-dynamic-api/ + args: + - IMAGE_TAG=${IMAGE_TAG:?} + image: ohmymndy/luminus-dynamic-api:${IMAGE_TAG:?} + environment: + SQLALCHEMY_DATABASE_URI: postgresql://postgres:password@postgres-lda:5432/luminus-dynamic-api + init: true + +services: + luminus-dynamic-api-web: + <<: *x-luminus-dynamic-api + ports: + - 5029:8000 + healthcheck: + test: + [ + "CMD", + "wget", + "--spider", + "-q", + "-T", + "1", + "http://0.0.0.0:8000/healthz", + ] + interval: 1m + timeout: 1s + start_period: 30s + start_interval: 2s + + luminus-dynamic-api-cli: + <<: *x-luminus-dynamic-api + entrypoint: ash + command: + - -c + - | + while true; do + python /app/sync.py + sleep 3600 + done + + postgres-lda: + image: postgres:17-alpine + restart: unless-stopped + environment: + - POSTGRES_USER=postgres + - POSTGRES_PASSWORD=password + - POSTGRES_DB=luminus-dynamic-api + healthcheck: + test: + [ + "CMD-SHELL", + "pg_isready -h localhost -U $${POSTGRES_USER} -d $${POSTGRES_DB}", + ] + interval: 5s + timeout: 5s + retries: 10