version: '3.1'

services:
  app:
    build:
      context: ../
      dockerfile: docker/php/Dockerfile
    networks:
      - app
    depends_on:
      - db

  db:
    image: postgres:16.2
    environment:
      POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
      POSTGRES_USER: ${DATABASE_USER}
      POSTGRES_DB: ${DATABASE_NAME}
    networks:
      - app
    ports:
      - '5432:5432'

  nginx:
    build:
      context: ../
      dockerfile: docker/nginx/Dockerfile
    ports:
      - '80:80'
      - '433:433'
    networks:
      - app
    links:
      - app
    depends_on:
      - app

networks:
  app:
    driver: bridge