version: '3.8'

services:
  app:
    build: .
    container_name: vwed_task_app
    restart: always
    ports:
      - "8000:8000"
    environment:
      - APP_ENV=production
      - DB_HOST=db
      - DB_USER=vwed
      - DB_PASSWORD=vwed_password
      - DB_NAME=vwed_task
      - REDIS_HOST=redis
      - SECRET_KEY=your_production_secret_key_here
    volumes:
      - ./logs:/app/logs
    depends_on:
      - db
      - redis

  db:
    image: mysql:8.0
    container_name: vwed_task_db
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=root_password
      - MYSQL_DATABASE=vwed_task
      - MYSQL_USER=vwed
      - MYSQL_PASSWORD=vwed_password
    volumes:
      - mysql_data:/var/lib/mysql
    ports:
      - "3306:3306"
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci

  redis:
    image: redis:6.2
    container_name: vwed_task_redis
    restart: always
    volumes:
      - redis_data:/data
    ports:
      - "6379:6379"

volumes:
  mysql_data:
  redis_data: 