services:
  autopremium-server:
    build: .
    container_name: autopremium-server
    restart: always
    ports:
      - '127.0.0.1:8080:8080'
    env_file:
      - .env
    environment:
      - REDIS_URL=redis://redis:6379
      - PYTHONUNBUFFERED=1
    depends_on:
      - redis
    volumes:
      - .:/app

  redis:
    image: redis:7-alpine
    container_name: autopremium-redis
    restart: always
    command: redis-server --appendonly yes
    volumes:
      - redis_data:/data

volumes:
  redis_data:
