NitinBot001 commited on
Commit
0f00101
·
verified ·
1 Parent(s): bf9b3a9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -20
Dockerfile CHANGED
@@ -1,31 +1,34 @@
1
- ARG BASE=node:20.18.0
2
- FROM ${BASE}
3
 
 
 
 
 
 
 
 
4
  WORKDIR /app
5
 
6
- # Install pnpm correctly (HF-safe)
7
- RUN corepack enable && corepack prepare pnpm@8.15.6 --activate
 
8
 
9
- # Copy package.json only
10
- # COPY package.json ./
 
11
 
12
- # Install deps
13
  RUN pnpm install
14
 
15
- # Copy rest of source
16
- COPY . .
17
-
18
- # Build
19
  RUN pnpm run build
20
 
21
- # HF-required port
 
22
  EXPOSE 7860
23
 
24
- ENV NODE_ENV=production \
25
- HOST=0.0.0.0 \
26
- PORT=7860 \
27
- VITE_HOST=0.0.0.0 \
28
- VITE_PORT=7860
29
-
30
- # DO NOT use wrangler (HF incompatible)
31
- CMD ["pnpm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use Node.js 20 (Compatible with Bolt.diy)
2
+ FROM node:20-slim
3
 
4
+ # Install git to clone the repo and ca-certificates for HTTPS
5
+ RUN apt-get update && apt-get install -y git ca-certificates && rm -rf /var/lib/apt/lists/*
6
+
7
+ # Install pnpm (required by the README)
8
+ RUN npm install -g pnpm
9
+
10
+ # Set the working directory
11
  WORKDIR /app
12
 
13
+ # Clone the specific repository
14
+ # We clone into the current directory (.)
15
+ RUN git clone https://github.com/tyrellshawn/bolt.diy.git .
16
 
17
+ # Create a default .env.local file to prevent build crashes
18
+ # You must set actual API keys in Hugging Face "Settings" -> "Variables/Secrets"
19
+ RUN cp .env.example .env.local
20
 
21
+ # Install dependencies
22
  RUN pnpm install
23
 
24
+ # Build the project
 
 
 
25
  RUN pnpm run build
26
 
27
+ # Expose the port Hugging Face expects
28
+ ENV PORT=7860
29
  EXPOSE 7860
30
 
31
+ # Start the application
32
+ # We use 'pnpm run start' which utilizes Wrangler Pages
33
+ # We pass flags to ensure it binds to the correct host and port for HF
34
+ CMD ["pnpm", "run", "start", "--", "--port", "7860", "--host", "0.0.0.0"]