version: '3.8'

services:
  bots-translation:
    build: .
    container_name: bots-translation
    restart: unless-stopped
    ports:
      - "8091:8000"
    volumes:
      - ./data:/app/data
    environment:
      - DISCORD_TOKEN=${DISCORD_TOKEN}
      - TELEGRAM_TOKEN=${TELEGRAM_TOKEN}
      - LIBRETRANSLATE_URL=${LIBRETRANSLATE_URL}
      - WEB_HOST=0.0.0.0
      - WEB_PORT=8000
      - ADMIN_USERNAME=${ADMIN_USERNAME}
      - ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - DB_TYPE=mysql
      - DB_HOST=${DB_HOST}
      - DB_PORT=${DB_PORT}
      - DB_USER=${DB_USER}
      - DB_PASSWORD=${DB_PASSWORD}
      - DB_NAME=${DB_NAME}
      - PYTHONDONTWRITEBYTECODE=1
      - PYTHONOPTIMIZE=1
    env_file:
      - .env
    mem_limit: 512m
    mem_reservation: 256m
    pids_limit: 50
