version: '3'
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    privileged: true
    ports:
      - "8080:8080"
    environment:
      - DB_DRIVER=org.postgresql.Driver
      - DB_URL=jdbc:postgresql://postgres:5432/db
      - DB_USERNAME=postgres
      - DB_PASSWORD=postgres
      - WAIT_FOR=postgres:5432
    networks:
      - nw
  postgres:
    image: "postgres"
    ports:
      - "5432:5432"
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=db
    networks:
      - nw
networks:
  nw:
