Heuehneje commited on
Commit
b0f0f4c
·
verified ·
1 Parent(s): d0e7fd7

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -6
Dockerfile CHANGED
@@ -11,15 +11,15 @@ RUN corepack enable pnpm
11
  WORKDIR /app
12
  RUN chown -R node:node /app
13
 
14
- # Initialize git repository (required for the build)
 
 
 
15
  RUN git init && \
16
  git config --global user.email "[email protected]" && \
17
  git config --global user.name "Docker Build" && \
18
  git config --global --add safe.directory /app
19
 
20
- # Switch to non-root user
21
- USER node
22
-
23
  # Install dependencies
24
  COPY --chown=node:node package.json pnpm-lock.yaml ./
25
  RUN pnpm install
@@ -28,8 +28,7 @@ RUN pnpm install
28
  COPY --chown=node:node . .
29
 
30
  # Add files to git to avoid build errors
31
- RUN git config --global --add safe.directory /app && \
32
- git add . && \
33
  git commit -m "Initial commit"
34
 
35
  # Set environment variables for build
 
11
  WORKDIR /app
12
  RUN chown -R node:node /app
13
 
14
+ # Switch to non-root user
15
+ USER node
16
+
17
+ # Initialize git repository as node user
18
  RUN git init && \
19
  git config --global user.email "[email protected]" && \
20
  git config --global user.name "Docker Build" && \
21
  git config --global --add safe.directory /app
22
 
 
 
 
23
  # Install dependencies
24
  COPY --chown=node:node package.json pnpm-lock.yaml ./
25
  RUN pnpm install
 
28
  COPY --chown=node:node . .
29
 
30
  # Add files to git to avoid build errors
31
+ RUN git add . && \
 
32
  git commit -m "Initial commit"
33
 
34
  # Set environment variables for build