raghub-fe / docs /deploy-hf-docker.md
lifedebugger's picture
Deploy files from GitHub repository with LFS
e0d2835
# Deploy to Hugging Face Spaces (Docker)
This project uses Laravel as runtime and serves the built React app from `public/fe`.
## What changed
- Dockerfile is now multi-stage:
- Build frontend with Vite
- Install PHP dependencies with Composer
- Run Laravel on port `7860`
- Startup script auto-creates `.env` from `.env.example` and generates `APP_KEY` if missing.
## Required runtime variables (Space Settings -> Variables/Secrets)
- `API_URL` (target backend API base URL for BFF proxy, example: `https://your-backend/api/v1`)
- Optional:
- `APP_ENV=production`
- `APP_DEBUG=false`
## Optional build variables
You can override these during Docker build:
- `VITE_API_URL`
- `VITE_DUMMY_AUTH_MODE`
- `VITE_APP_BASENAME`
If not set, Dockerfile defaults are used.
## Health check
After deploy, test:
- `/` (Laravel welcome page)
- `/fe/login` (React app)
- `/api/bff/health` (BFF health)