GodRad commited on
Commit
45df597
·
verified ·
1 Parent(s): d8f999e

Upload 37 files

Browse files
Files changed (2) hide show
  1. Dockerfile +32 -0
  2. README.md +3 -2
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Multi-stage build for Admin UI
2
+ FROM node:18-alpine AS build
3
+
4
+ WORKDIR /app
5
+
6
+ # Copy package files and install dependencies
7
+ COPY package*.json ./
8
+ RUN npm install
9
+
10
+ # Copy source and build
11
+ COPY . .
12
+ # Note: VITE_API_BASE_URL can be provided as a build arg or picked up from environment at runtime if using a specific vite setup,
13
+ # but for static builds it's usually baked in. HF Spaces Docker can handle this.
14
+ ARG VITE_API_BASE_URL
15
+ ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
16
+
17
+ RUN npm run build
18
+
19
+ # Stage 2: Serve with Nginx
20
+ FROM nginx:alpine
21
+
22
+ # Copy build artifacts to nginx public folder
23
+ COPY --from=build /app/dist /usr/share/nginx/html
24
+
25
+ # Expose port (HF Spaces standard)
26
+ EXPOSE 7860
27
+
28
+ # Configure Nginx for SPA routing and custom port
29
+ RUN sed -i 's/listen\(.*\)80;/listen 7860;/' /etc/nginx/conf.d/default.conf && \
30
+ sed -i '/location \/ {/a \ try_files $uri $uri/ /index.html;' /etc/nginx/conf.d/default.conf
31
+
32
+ CMD ["nginx", "-g", "daemon off;"]
README.md CHANGED
@@ -19,10 +19,11 @@ A secure, enterprise-grade React application for global platform administration
19
 
20
  ## 📦 Deployment on Hugging Face Spaces
21
 
22
- 1. Create a new **Static Space** on Hugging Face.
23
  2. Under **Settings > Variables & Secrets**, add:
24
- - `VITE_API_BASE_URL`: The URL of your RAG SaaS API.
25
  3. Push the contents of this directory.
 
26
 
27
  ## 💻 Local Development
28
 
 
19
 
20
  ## 📦 Deployment on Hugging Face Spaces
21
 
22
+ 1. Create a new **Docker Space** on Hugging Face.
23
  2. Under **Settings > Variables & Secrets**, add:
24
+ - `VITE_API_BASE_URL`: The Direct URL of your RAG SaaS API (e.g., `https://user-backend.hf.space`).
25
  3. Push the contents of this directory.
26
+ 4. HF will build the image using the provided `Dockerfile` and serve it on port 7860.
27
 
28
  ## 💻 Local Development
29