services:
  bot:
    build:
      context: .
    volumes:
      - ./db:/db
    env_file:
      - .env
    environment:
      TZ: Europe/Moscow
      PENIS_DB_PATH: /db/penis_stats.sqlite3
      CHAT_HISTORY_DB_PATH: /db/chat_history.sqlite3
      POLYCHAETSI_STATS_PATH: /db/polychaetsi_stats.json
      BET_DB_PATH: /db/bets.sqlite3
    init: true
    restart: unless-stopped

  webapp-api:
    build:
      context: .
      dockerfile: Dockerfile.api
    volumes:
      - ./db:/db
    env_file:
      - .env
    environment:
      TZ: Europe/Moscow
      PENIS_DB_PATH: /db/penis_stats.sqlite3
      CHAT_HISTORY_DB_PATH: /db/chat_history.sqlite3
      POLYCHAETSI_STATS_PATH: /db/polychaetsi_stats.json
      BET_DB_PATH: /db/bets.sqlite3
      API_PORT: "8080"
    restart: unless-stopped

  webapp-frontend:
    build:
      context: ./webapp/frontend
    ports:
      - "3000:80"
    depends_on:
      - webapp-api
    restart: unless-stopped
