Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +23 -20
Dockerfile
CHANGED
|
@@ -1,31 +1,34 @@
|
|
| 1 |
-
|
| 2 |
-
FROM
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
#
|
|
|
|
| 11 |
|
| 12 |
-
# Install
|
| 13 |
RUN pnpm install
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
COPY . .
|
| 17 |
-
|
| 18 |
-
# Build
|
| 19 |
RUN pnpm run build
|
| 20 |
|
| 21 |
-
#
|
|
|
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 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"]
|
|
|
|
|
|
|
|
|
|
|
|