version: "3.9"

services:
  app:
    build:
      context: ..
      dockerfile: .devcontainer/Dockerfile
    volumes:
      - ..:/workspace:cached
    command: sleep infinity
    environment:
      NODE_ENV: development
      DATABASE_URL: postgres://postgres:postgres@db:5432/app
    ports:
      - "3720:3720"
      - "4220:4220"
      - "35173:5173"
    depends_on:
      - db

  db:
    image: postgres:16
    restart: unless-stopped
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: app
    volumes:
      - postgres-data:/var/lib/postgresql/data
    ports:
      - "35432:5432" # optional, useful for DB tools

volumes:
  postgres-data:
