services:
  web:
    build:
      context: .
      dockerfile: Dockerfile.dev
    ports:
      - "3000:3000"
      - "3036:3036"
    volumes:
      - .:/app
      - bundle_cache:/usr/local/bundle
      - node_modules:/app/node_modules
    environment:
      - RAILS_ENV=development
      - DATABASE_URL=postgres://postgres:secureorpheus123@db:5432/app_development
      - POSTGRES_HOST=db
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=secureorpheus123
      - TEST_DATABASE_URL=postgres://postgres:secureorpheus123@db:5432/app_test
    depends_on:
      - db
    command: ["sleep", "infinity"]

  db:
    image: postgres:16
    volumes:
      - harbor_postgres_data:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=secureorpheus123
      - POSTGRES_USER=postgres
      - POSTGRES_DB=app_development
    ports:
      - "5432:5432"

volumes:
  harbor_postgres_data:
  bundle_cache:
  node_modules:
