news-backend 0.1.0

Personalized article recommendations without profiling or cookies.
services:
  # -------------------------------------------------
  # API backend (Rust/Diesel)
  # -------------------------------------------------
  regulatory_api:
    build:
      context: ./backend          # Dockerfile lives here
      dockerfile: Dockerfile
    container_name: regulatory_api
    restart: unless-stopped
    ports:
      - "3001:3000"
    env_file: [.env]                      # loads all .env vars
    environment:
      DATABASE_URL: ${DATABASE_URL}
    depends_on:
      db:
        condition: service_healthy
  # -------------------------------------------------
  # PostgreSQL (for Diesel migrations)
  # -------------------------------------------------
  db:
    image: postgres:15-alpine
    container_name: regulatory_db
    restart: unless-stopped
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
    volumes:
      - pg_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
      interval: 10s
      timeout: 5s
      retries: 5

  # -------------------------------------------------
  # Health UI (React/Vite) – preview server
  # -------------------------------------------------
  health-ui:
    build:
      context: ./health-frontend
      dockerfile: Dockerfile
    container_name: health_ui
    restart: unless-stopped
    ports:
      - "8081:80"                # maps preview server (port 80 inside) to host 8081
    depends_on:
      - regulatory_api

  # -------------------------------------------------
  # Locker UI (React/Vite) – preview server
  # -------------------------------------------------
  locker-ui:
    build:
      context: ./locker-frontend
      dockerfile: Dockerfile
    container_name: locker_ui
    restart: unless-stopped
    ports:
      - "8082:80"
    depends_on:
      - regulatory_api

  # -------------------------------------------------
  # News UI (Next.js) – server‑side rendering
  # -------------------------------------------------
  news-ui:
    build:
      context: ./news-frontend
      dockerfile: Dockerfile
    container_name: news_ui
    restart: unless-stopped
    ports:
      - "8083:3000"              # Next.js server runs on 3000 inside the container
    depends_on:
      - regulatory_api

volumes:
  pg_data: