Update Dockerfile
Browse files- Dockerfile +11 -0
Dockerfile
CHANGED
|
@@ -1,17 +1,28 @@
|
|
| 1 |
FROM node:20
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y git bash
|
| 4 |
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
|
|
|
| 7 |
RUN git clone --depth=1 --branch stable https://github.com/stackblitz-labs/bolt.diy.git .
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
RUN chown -R node:node /app
|
| 10 |
|
|
|
|
| 11 |
USER node
|
| 12 |
|
|
|
|
| 13 |
RUN npx --yes pnpm install
|
| 14 |
|
|
|
|
| 15 |
EXPOSE 7860
|
| 16 |
|
|
|
|
| 17 |
CMD ["npx", "--yes", "pnpm", "run", "dev", "--host", "0.0.0.0", "-p", "7860"]
|
|
|
|
| 1 |
FROM node:20
|
| 2 |
|
| 3 |
+
# Install git, bash and sed
|
| 4 |
RUN apt-get update && apt-get install -y git bash
|
| 5 |
|
| 6 |
+
# Set working directory
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
+
# Clone the Bolt DIY repo
|
| 10 |
RUN git clone --depth=1 --branch stable https://github.com/stackblitz-labs/bolt.diy.git .
|
| 11 |
|
| 12 |
+
# Patch vite.config.ts to allow Hugging Face domains
|
| 13 |
+
RUN sed -i "/defineConfig({/a\ \ \ server: {\n\ \ \ \ \ \ host: '0.0.0.0',\n\ \ \ \ \ \ port: 7860,\n\ \ \ \ \ \ allowedHosts: ['.hf.space']\n\ \ \ }," vite.config.ts
|
| 14 |
+
|
| 15 |
+
# Set correct ownership
|
| 16 |
RUN chown -R node:node /app
|
| 17 |
|
| 18 |
+
# Use non-root user
|
| 19 |
USER node
|
| 20 |
|
| 21 |
+
# Install dependencies
|
| 22 |
RUN npx --yes pnpm install
|
| 23 |
|
| 24 |
+
# Expose port for Hugging Face
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
+
# Start dev server
|
| 28 |
CMD ["npx", "--yes", "pnpm", "run", "dev", "--host", "0.0.0.0", "-p", "7860"]
|