# Update docker-compose.yml to mount source code as volume version: '3.8' services: timescaledb: image: timescale/timescaledb:2.11.2-pg15 container_name: btc_timescale environment: POSTGRES_USER: btc_bot POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_DB: btc_data TZ: Europe/Warsaw volumes: - /volume1/btc_bot/data:/var/lib/postgresql/data - /volume1/btc_bot/backups:/backups - ./timescaledb.conf:/etc/postgresql/postgresql.conf - ./init-scripts:/docker-entrypoint-initdb.d ports: - "5433:5432" command: postgres -c config_file=/etc/postgresql/postgresql.conf restart: unless-stopped deploy: resources: limits: memory: 1.5G reservations: memory: 512M healthcheck: test: ["CMD-SHELL", "pg_isready -U btc_bot -d btc_data"] interval: 10s timeout: 5s retries: 5 data_collector: build: context: .. dockerfile: docker/Dockerfile.collector image: btc_collector container_name: btc_collector network_mode: host environment: - DB_HOST=localhost - DB_PORT=5433 - DB_NAME=btc_data - DB_USER=btc_bot - DB_PASSWORD=${DB_PASSWORD} - LOG_LEVEL=INFO volumes: - ../src:/app/src - /volume1/btc_bot/logs:/app/logs - ../config:/app/config:ro depends_on: timescaledb: condition: service_healthy restart: unless-stopped deploy: resources: limits: memory: 256M reservations: memory: 128M api_server: build: context: .. dockerfile: docker/Dockerfile.api image: btc_api container_name: btc_api network_mode: host environment: - DB_HOST=localhost - DB_PORT=5433 - DB_NAME=btc_data - DB_USER=btc_bot - DB_PASSWORD=${DB_PASSWORD} volumes: - ../src:/app/src - /volume1/btc_bot/exports:/app/exports - ../config:/app/config:ro depends_on: - timescaledb restart: unless-stopped deploy: resources: limits: memory: 512M ping_pong_bot: build: context: .. dockerfile: docker/Dockerfile.bot image: btc_ping_pong_bot container_name: btc_ping_pong_bot network_mode: host environment: - API_KEY=${API_KEY} - API_SECRET=${API_SECRET} - LOG_LEVEL=INFO volumes: - ../src:/app/src - /volume1/btc_bot/logs:/app/logs - ../config:/app/config:ro - ../.env:/app/.env:ro restart: unless-stopped deploy: resources: limits: memory: 256M reservations: memory: 128M