version: '3.1'

services:
  db:
    image: postgres:16.2
    environment:
      POSTGRES_PASSWORD: 'root'
      POSTGRES_USER: 'root'
    networks:
      - app
    ports:
      - '5432:5432'

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

  app:
    build:
      dockerfile: Dockerfile
    networks:
      - app
    depends_on:
      - db

networks:
  app:
    driver: bridge