Spaces:
Runtime error
Runtime error
| version: '3.8' | |
| services: | |
| db: | |
| image: postgres:15 | |
| container_name: customs_db | |
| environment: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: customs_data | |
| ports: | |
| - "5433:5432" | |
| volumes: | |
| - customs_pgdata:/var/lib/postgresql/data | |
| healthcheck: | |
| test: ["CMD-SHELL", "pg_isready -U postgres -d customs_data"] | |
| interval: 5s | |
| timeout: 5s | |
| retries: 5 | |
| restart: always | |
| clickhouse: | |
| image: clickhouse/clickhouse-server:23.8 | |
| container_name: customs_clickhouse | |
| ports: | |
| - "8123:8123" | |
| - "9000:9000" | |
| environment: | |
| CLICKHOUSE_DB: customs_data | |
| CLICKHOUSE_USER: default | |
| CLICKHOUSE_PASSWORD: password | |
| volumes: | |
| - customs_chdata:/var/lib/clickhouse | |
| healthcheck: | |
| test: ["CMD", "wget", "--spider", "-q", "-O", "-", "http://localhost:8123/ping"] | |
| interval: 5s | |
| timeout: 5s | |
| retries: 5 | |
| restart: always | |
| elasticsearch: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2 | |
| container_name: customs_es | |
| environment: | |
| - discovery.type=single-node | |
| - xpack.security.enabled=false | |
| - "ES_JAVA_OPTS=-Xms512m -Xmx512m" | |
| ports: | |
| - "9200:9200" | |
| volumes: | |
| - customs_esdata:/usr/share/elasticsearch/data | |
| healthcheck: | |
| test: ["CMD-SHELL", "curl -s http://localhost:9200 >/dev/null || exit 1"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 5 | |
| restart: always | |
| api: | |
| build: . | |
| ports: | |
| - "8000:8000" | |
| depends_on: | |
| db: | |
| condition: service_healthy | |
| clickhouse: | |
| condition: service_healthy | |
| elasticsearch: | |
| condition: service_healthy | |
| volumes: | |
| - .:/app | |
| environment: | |
| - DATABASE_URL=postgresql+asyncpg://postgres:postgres@db:5432/customs_data | |
| - CLICKHOUSE_URL=http://default:password@clickhouse:8123 | |
| - ELASTICSEARCH_URL=http://elasticsearch:9200 | |
| scheduler: | |
| build: . | |
| depends_on: | |
| db: | |
| condition: service_healthy | |
| volumes: | |
| - .:/app | |
| environment: | |
| - DATABASE_URL=postgresql+asyncpg://postgres:postgres@db:5432/customs_data | |
| - CLICKHOUSE_URL=http://default:password@clickhouse:8123 | |
| - ELASTICSEARCH_URL=http://elasticsearch:9200 | |
| command: ["bash", "-c", "python infrastructure/scheduler/main.py"] | |
| volumes: | |
| customs_pgdata: | |
| customs_chdata: | |
| customs_esdata: | |