services:
  app:
    build:
      context: .
      target: production
    image: upweb-app:latest
    restart: unless-stopped
    env_file:
      - .env
    environment:
      APP_ENV: production
      APP_DEBUG: "false"
      DB_HOST: db
    volumes:
      - upweb-storage:/var/www/html/storage
    depends_on:
      db:
        condition: service_healthy

  web:
    build:
      context: .
      dockerfile: docker/nginx/Dockerfile
      args:
        APP_IMAGE: upweb-app:latest
    restart: unless-stopped
    ports:
      - "${APP_PORT:-80}:80"
    depends_on:
      - app

  db:
    restart: unless-stopped
    ports: []

  vite:
    profiles: [never]

volumes:
  upweb-storage: