services:
  backend:
    build: ./backend
    container_name: bellsystems-backend
    env_file: .env
    volumes:
      - ./backend:/app
      - ./data:/app/data
      - ./data/built_melodies:/app/storage/built_melodies
      - ./data/firmware:/app/storage/firmware
      - ./data/flash_assets:/app/storage/flash_assets
      - ./data/firebase-service-account.json:/app/firebase-service-account.json:ro
    ports:
      - "8000:8000"
    networks:
      - internal

  frontend:
    build: ./frontend
    container_name: bellsystems-frontend
    volumes:
      - ./frontend:/app
      - /app/node_modules
    ports:
      - "5173:5174"
      - "8001:5174"
    networks:
      - internal

  nginx:
    image: nginx:alpine
    container_name: bellsystems-nginx
    ports:
      - "90:80"     # access v2 on localhost:8001
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - backend
      - frontend
    networks:
      - internal

networks:
  internal:
    driver: bridge
