Update Dockerfile
Browse files- Dockerfile +4 -20
Dockerfile
CHANGED
|
@@ -1,35 +1,19 @@
|
|
| 1 |
FROM node:lts-alpine
|
| 2 |
|
| 3 |
-
# Install git and bash
|
| 4 |
RUN apk add --no-cache git bash
|
| 5 |
|
| 6 |
-
# Create a non-root user with UID 1000
|
| 7 |
-
RUN adduser -D -u 1000 user
|
| 8 |
-
|
| 9 |
-
# Set environment variables
|
| 10 |
-
ENV HOME=/home/user
|
| 11 |
-
ENV NODE_ENV=development
|
| 12 |
-
|
| 13 |
-
# Set working directory
|
| 14 |
WORKDIR /app
|
| 15 |
|
| 16 |
-
# Clone the repository
|
| 17 |
RUN git clone --depth=1 --branch stable https://github.com/stackblitz-labs/bolt.diy.git .
|
| 18 |
|
| 19 |
-
# Change ownership
|
| 20 |
-
RUN chown -R
|
| 21 |
|
| 22 |
-
# Switch to
|
| 23 |
-
USER
|
| 24 |
|
| 25 |
-
# Install pnpm globally
|
| 26 |
RUN npm install -g pnpm
|
| 27 |
-
|
| 28 |
-
# Install dependencies
|
| 29 |
RUN pnpm install
|
| 30 |
|
| 31 |
-
# Expose port 7860
|
| 32 |
EXPOSE 7860
|
| 33 |
-
|
| 34 |
-
# Start the development server
|
| 35 |
CMD ["pnpm", "run", "dev", "-p", "7860"]
|
|
|
|
| 1 |
FROM node:lts-alpine
|
| 2 |
|
|
|
|
| 3 |
RUN apk add --no-cache 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 |
+
# Change ownership to existing "node" user
|
| 10 |
+
RUN chown -R node:node /app
|
| 11 |
|
| 12 |
+
# Switch to non-root user (already exists)
|
| 13 |
+
USER node
|
| 14 |
|
|
|
|
| 15 |
RUN npm install -g pnpm
|
|
|
|
|
|
|
| 16 |
RUN pnpm install
|
| 17 |
|
|
|
|
| 18 |
EXPOSE 7860
|
|
|
|
|
|
|
| 19 |
CMD ["pnpm", "run", "dev", "-p", "7860"]
|