version: '3.8'
services:
  app:
    image: node:18-alpine
    working_dir: /app
    ports:
      - '3000:3000'
    volumes:
      - .:/app
    environment:
      - NODE_ENV=production
      - PORT=3000
    command: npm start
  db:
    image: postgres:15
    environment:
      POSTGRES_DB: appdb
      POSTGRES_USER: user
      POSTGRES_PASSWORD: secret
    volumes:
      - pgdata:/var/lib/postgresql/data
volumes:
  pgdata:
