File size: 2,547 Bytes
35bdde1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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: