Update Dockerfile
Browse files- Dockerfile +14 -15
Dockerfile
CHANGED
|
@@ -1,32 +1,31 @@
|
|
| 1 |
FROM node:lts-alpine
|
| 2 |
|
| 3 |
-
# Install
|
| 4 |
-
RUN apk add --no-cache git bash
|
| 5 |
|
| 6 |
-
# Create
|
| 7 |
-
RUN
|
| 8 |
|
| 9 |
-
# Set
|
| 10 |
-
|
| 11 |
-
PATH=/home/user/.local/bin:$PATH
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
USER
|
| 18 |
|
| 19 |
-
# Clone the
|
| 20 |
RUN git clone --depth=1 --branch stable https://github.com/stackblitz-labs/bolt.diy.git .
|
| 21 |
|
| 22 |
# Install pnpm globally
|
| 23 |
RUN npm install -g pnpm
|
| 24 |
|
| 25 |
-
# Install
|
| 26 |
RUN pnpm install
|
| 27 |
|
| 28 |
-
# Expose port
|
| 29 |
EXPOSE 7860
|
| 30 |
|
| 31 |
-
# Start the
|
| 32 |
CMD ["pnpm", "run", "dev", "-p", "7860"]
|
|
|
|
| 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 and group
|
| 7 |
+
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
| 8 |
|
| 9 |
+
# Set working directory
|
| 10 |
+
WORKDIR /app
|
|
|
|
| 11 |
|
| 12 |
+
# Change ownership of the working directory
|
| 13 |
+
RUN chown -R appuser:appgroup /app
|
| 14 |
|
| 15 |
+
# Switch to the non-root user
|
| 16 |
+
USER appuser
|
| 17 |
|
| 18 |
+
# Clone the repository
|
| 19 |
RUN git clone --depth=1 --branch stable https://github.com/stackblitz-labs/bolt.diy.git .
|
| 20 |
|
| 21 |
# Install pnpm globally
|
| 22 |
RUN npm install -g pnpm
|
| 23 |
|
| 24 |
+
# Install dependencies
|
| 25 |
RUN pnpm install
|
| 26 |
|
| 27 |
+
# Expose port 7860
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
+
# Start the development server
|
| 31 |
CMD ["pnpm", "run", "dev", "-p", "7860"]
|