version: '3.1'

services:
  db:
    build: backend/db
    container_name: postgres-db
    environment:
      POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    ports:
      - "${POSTGRES_PORT}:5432"
    volumes:
      - ./backend/pgdata:/var/lib/postgresql/data

  api:
    build: backend/api
    depends_on:
      - db
    container_name: express-api
    ports:
      - "${EXPRESS_PORT}:3000"

