lea-GEO / docker-compose.yml
hsmm's picture
Initial commit for HF Space
35bdde1
version: "3.9"
services:
postgres:
image: postgres:16
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
- ./db/schema.sql:/docker-entrypoint-initdb.d/001_schema.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 5s
timeout: 3s
retries: 30
minio:
image: minio/minio:RELEASE.2025-01-20T00-00-00Z
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio-data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 3s
retries: 30
minio-init:
image: minio/mc:RELEASE.2025-01-17T00-00-00Z
depends_on:
minio:
condition: service_healthy
entrypoint: ["/bin/sh", "-c"]
command: >
mc alias set local ${RUNNER_S3_ENDPOINT} ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD} &&
(mc ls local/${MINIO_BUCKET} >/dev/null 2>&1 || mc mb local/${MINIO_BUCKET}) &&
mc anonymous set download local/${MINIO_BUCKET} || true
db-service:
build:
context: ./db_service
environment:
DATABASE_URL: ${DATABASE_URL}
ports:
- "${DB_SERVICE_PORT}:8000"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 5s
timeout: 3s
retries: 30
runner:
build:
context: ./runner_service
environment:
RUNNER_PROFILES_DIR: ${RUNNER_PROFILES_DIR}
RUNNER_S3_ENDPOINT: ${RUNNER_S3_ENDPOINT}
RUNNER_S3_ACCESS_KEY: ${RUNNER_S3_ACCESS_KEY}
RUNNER_S3_SECRET_KEY: ${RUNNER_S3_SECRET_KEY}
RUNNER_S3_BUCKET: ${RUNNER_S3_BUCKET}
RUNNER_S3_REGION: ${RUNNER_S3_REGION}
RUNNER_S3_SECURE: ${RUNNER_S3_SECURE}
ports:
- "8000:8000"
volumes:
- runner-profiles:/data/profiles
depends_on:
minio:
condition: service_healthy
minio-init:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 5s
timeout: 3s
retries: 30
volumes:
pgdata:
minio-data:
runner-profiles: