# version: "3.8"

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: stream-xtube-app
    restart: unless-stopped
    ports:
      - "127.0.0.1:8001:80"
    volumes:
      - ./storage:/app/storage
      - ./bootstrap/cache:/app/bootstrap/cache
      - ./public/storage:/app/public/storage
      - /etc/letsencrypt:/etc/letsencrypt:ro
    environment:
      - APP_ENV=production
      - APP_DEBUG=false
      - LOG_CHANNEL=stdout
      - DB_CONNECTION=pgsql
    env_file:
      - .env.docker
    networks:
      - app-network
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost/health.php"]
      interval: 15s
      timeout: 5s
      retries: 3
      start_period: 40s
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

networks:
  app-network:
    driver: bridge
