version: '3.9'

services:
  nextjs:
    build: .
    ports:
      - "3000:3000"
    depends_on:
      - jsonserver
    environment:
      NEXT_PUBLIC_API_URL: "http://jsonserver:4000"

  jsonserver:
    image: clue/json-server
    ports:
      - "4000:4000"
    volumes:
      - ./db.json:/data/db.json
    command: json-server --watch /db.json --port 4000