services:
  frankenphp:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: sawnoff-league-app
    ports:
      - "8080:80"
      - "8443:443"
    volumes:
      - .:/app
      - ./var:/app/var
    environment:
      SERVER_NAME: ":80"
      DATABASE_URL: "postgresql://sawnoff:sawnoff123@db:5432/sawnoff_league?serverVersion=16&charset=utf8"
      APP_ENV: dev
      APP_SECRET: ${APP_SECRET:-changeme_this_is_dev_secret}
    depends_on:
      - db
    networks:
      - sawnoff-network
    command: ["php", "-S", "0.0.0.0:80", "-t", "public"]

  db:
    image: postgres:16-alpine
    container_name: sawnoff-league-db
    environment:
      POSTGRES_DB: sawnoff_league
      POSTGRES_USER: sawnoff
      POSTGRES_PASSWORD: sawnoff123
    ports:
      - "5432:5432"
    volumes:
      - db_data:/var/lib/postgresql/data
    networks:
      - sawnoff-network

networks:
  sawnoff-network:
    driver: bridge

volumes:
  db_data:
