mfoud444 commited on
Commit
3fbcc88
·
verified ·
1 Parent(s): 0f3cbaf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -8
Dockerfile CHANGED
@@ -3,21 +3,25 @@ FROM node:lts-alpine
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
 
 
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 of the application files to the non-root user
20
+ RUN chown -R user:user /app
21
+
22
+ # Switch to the non-root user
23
+ USER user
24
+
25
  # Install pnpm globally
26
  RUN npm install -g pnpm
27