flen-crypto commited on
Commit
1596e3f
·
verified ·
1 Parent(s): f11724e

Upload index.html with huggingface_hub

Browse files
Files changed (1) hide show
  1. index.html +44 -19
index.html CHANGED
@@ -1,19 +1,44 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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;"]