|
| 1 | +services: |
| 2 | + gateway_app: |
| 3 | + build: |
| 4 | + context: gateway/ |
| 5 | + container_name: gateway_app |
| 6 | + env_file: |
| 7 | + - ./gateway/.env |
| 8 | + ports: |
| 9 | + - "${GATEWAY_PORT}:${GATEWAY_PORT}" |
| 10 | + entrypoint: ["sh", "-c"] |
| 11 | + command: |
| 12 | + - | |
| 13 | + poetry run uvicorn main:app \ |
| 14 | + --host 0.0.0.0 \ |
| 15 | + --port ${GATEWAY_PORT} |
| 16 | + depends_on: |
| 17 | + loki: |
| 18 | + condition: service_started |
| 19 | + |
| 20 | + tasks_app: |
| 21 | + build: |
| 22 | + context: tasks/ |
| 23 | + container_name: tasks_app |
| 24 | + env_file: |
| 25 | + - ./tasks/.env |
| 26 | + ports: |
| 27 | + - "${TASKS_APP_PORT}" |
| 28 | + entrypoint: ["sh", "-c"] |
| 29 | + command: |
| 30 | + - | |
| 31 | + chmod +x /app/scripts/*.sh && |
| 32 | + /app/scripts/init_db.sh && |
| 33 | + poetry run uvicorn main:app \ |
| 34 | + --host 0.0.0.0 \ |
| 35 | + --port ${TASKS_APP_PORT} |
| 36 | + depends_on: |
| 37 | + db_tasks_app: |
| 38 | + condition: service_healthy |
| 39 | + loki: |
| 40 | + condition: service_started |
| 41 | + |
| 42 | + db_tasks_app: |
| 43 | + image: postgres:17 |
| 44 | + container_name: db_tasks_app |
| 45 | + env_file: |
| 46 | + - ./tasks/.env |
| 47 | + environment: |
| 48 | + POSTGRES_USER: ${TASKS_DB_USER} |
| 49 | + POSTGRES_PASSWORD: ${TASKS_DB_PASS} |
| 50 | + POSTGRES_DB: ${TASKS_DB_NAME} |
| 51 | + ports: |
| 52 | + - "${TASKS_DB_PORT}" |
| 53 | + volumes: |
| 54 | + - db_tasks_app:/var/lib/postgresql/data |
| 55 | + healthcheck: |
| 56 | + test: ["CMD-SHELL", "pg_isready -U ${TASKS_DB_USER}"] |
| 57 | + interval: 5s |
| 58 | + timeout: 5s |
| 59 | + retries: 5 |
| 60 | + |
| 61 | + loki: |
| 62 | + image: grafana/loki:latest |
| 63 | + ports: |
| 64 | + - "${LOKI_PORT}" |
| 65 | + volumes: |
| 66 | + - ./loki-config.yaml:/etc/loki/local-config.yaml |
| 67 | + - loki_data:/loki |
| 68 | + command: |
| 69 | + - -config.expand-env=true |
| 70 | + - -config.file=/etc/loki/local-config.yaml |
| 71 | + environment: |
| 72 | + LOKI_PORT: ${LOKI_PORT} |
| 73 | + |
| 74 | + promtail: |
| 75 | + image: grafana/promtail:latest |
| 76 | + volumes: |
| 77 | + - ./promtail-config.yaml:/etc/promtail/config.yaml |
| 78 | + - /var/run/docker.sock:/var/run/docker.sock |
| 79 | + - /var/lib/docker/containers:/var/lib/docker/containers:ro |
| 80 | + command: |
| 81 | + - -config.expand-env=true |
| 82 | + - -config.file=/etc/promtail/config.yaml |
| 83 | + environment: |
| 84 | + LOKI_URL: http://loki:${LOKI_PORT}/loki/api/v1/push |
| 85 | + depends_on: |
| 86 | + - loki |
| 87 | + |
| 88 | + grafana: |
| 89 | + image: grafana/grafana:latest |
| 90 | + ports: |
| 91 | + - "${GRAFANA_PORT}:3000" |
| 92 | + volumes: |
| 93 | + - grafana_data:/var/lib/grafana |
| 94 | + environment: |
| 95 | + - GF_SECURITY_ADMIN_USER=admin |
| 96 | + - GF_SECURITY_ADMIN_PASSWORD=admin |
| 97 | + - GF_USERS_ALLOW_SIGN_UP=false |
| 98 | + |
| 99 | +volumes: |
| 100 | + db_tasks_app: |
| 101 | + loki_data: |
| 102 | + grafana_data: |
0 commit comments