File size: 909 Bytes
47d0547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# 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)