services:
  postgres:
    image: postgres:15-alpine
    restart: always
    ports:
      - 5432:5432
    volumes:
      - /var/lib/postgresql/data
    environment:
      POSTGRES_DB: games_app
      POSTGRES_HOST_AUTH_METHOD: trust
    networks:
      - games
  games-app:
    build: .
    depends_on:
      - postgres
    ports:
      - 4000:4000
      - 4001:4001
      - 9229:9229
    volumes:
      - .:/usr/src/app
      - /usr/src/app/.pnpm-store
      - /usr/src/app/node_modules
    command: pnpm dev
    environment:
      PORT: 4000
      IP: 0.0.0.0
      DATABASE_URL: postgresql://postgres@postgres/games_app
    networks:
      - games
networks:
  games: