services:
    caddy:
        image: caddy:2-alpine
        container_name: caddy
        restart: unless-stopped
        environment:
            - FRONTEND_UPSTREAM=frontend-dev:4321
        ports:
            - "8080:80"
        volumes:
            - ./Caddyfile:/etc/caddy/Caddyfile
        depends_on:
            - frontend-dev

    frontend-dev:
        image: boost-ai/demo-frontend-dev:${DEV_TAG:?error DEV_TAG environment variable not set}
        container_name: frontend-dev
        restart: unless-stopped
        volumes:
            - ./Frontend:/app
            - ./Mock-Data:/Mock-Data
            - BoostAI_node_modules:/app/node_modules
        command: ["pnpm", "dev", "--host", "0.0.0.0", "--port", "4321"]
        environment:
            - NODE_ENV=development
            - ALLOWED_HOSTS=windows-wsl

volumes:
    BoostAI_node_modules:
