Spaces:
Running
Running
Upload index.html with huggingface_hub
Browse files- index.html +44 -19
index.html
CHANGED
|
@@ -1,19 +1,44 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -----------------------------------------------
|
| 2 |
+
# Multi-stage Dockerfile for a React + Vite PWA
|
| 3 |
+
# -----------------------------------------------
|
| 4 |
+
|
| 5 |
+
# 1) Build stage
|
| 6 |
+
FROM node:20-alpine AS build
|
| 7 |
+
|
| 8 |
+
WORKDIR /app
|
| 9 |
+
|
| 10 |
+
# Install global pnpm for faster installs
|
| 11 |
+
RUN corepack enable && corepack prepare pnpm@latest --activate
|
| 12 |
+
|
| 13 |
+
# Copy dependency manifests first for better layer caching
|
| 14 |
+
COPY package.json pnpm-lock.yaml ./
|
| 15 |
+
|
| 16 |
+
# Install all dependencies (including devDependencies for build)
|
| 17 |
+
RUN pnpm install --frozen-lockfile
|
| 18 |
+
|
| 19 |
+
# Copy source files
|
| 20 |
+
COPY . .
|
| 21 |
+
|
| 22 |
+
# Build the production bundle
|
| 23 |
+
RUN pnpm run build
|
| 24 |
+
|
| 25 |
+
# -----------------------------------------------
|
| 26 |
+
# 2) Runtime stage – tiny nginx image
|
| 27 |
+
# -----------------------------------------------
|
| 28 |
+
FROM nginx:1.25-alpine
|
| 29 |
+
|
| 30 |
+
# Copy built static assets from build stage
|
| 31 |
+
COPY --from=build /app/dist /usr/share/nginx/html
|
| 32 |
+
|
| 33 |
+
# Copy custom nginx config to serve SPA & PWA headers
|
| 34 |
+
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
| 35 |
+
|
| 36 |
+
# Allow nginx to bind to privileged ports as non-root
|
| 37 |
+
RUN touch /var/run/nginx.pid && \
|
| 38 |
+
chown -R nginx:nginx /var/run/nginx.pid /usr/share/nginx/html /var/cache/nginx
|
| 39 |
+
|
| 40 |
+
USER nginx
|
| 41 |
+
|
| 42 |
+
EXPOSE 80
|
| 43 |
+
|
| 44 |
+
CMD ["nginx", "-g", "daemon off;"]
|