Charan5775 commited on
Commit
f5a9700
·
verified ·
1 Parent(s): 2e3abf8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -4
Dockerfile CHANGED
@@ -3,15 +3,19 @@ FROM ${BASE} AS base
3
 
4
  WORKDIR /app
5
 
6
- # Change ownership of the /app directory to the existing node user
 
 
 
 
7
  RUN chown -R node:node /app
8
 
9
- # Switch to the node user
10
  USER node
11
 
12
- # Install dependencies (cached step)
13
  COPY package.json pnpm-lock.yaml ./
14
- RUN corepack enable pnpm && pnpm install
15
 
16
  # Copy the rest of your app's source code
17
  COPY --chown=node:node . .
 
3
 
4
  WORKDIR /app
5
 
6
+ # Temporarily switch to root to enable pnpm globally
7
+ USER root
8
+ RUN corepack enable pnpm
9
+
10
+ # Change ownership of the /app directory to the node user
11
  RUN chown -R node:node /app
12
 
13
+ # Switch back to the node user
14
  USER node
15
 
16
+ # Install dependencies
17
  COPY package.json pnpm-lock.yaml ./
18
+ RUN pnpm install
19
 
20
  # Copy the rest of your app's source code
21
  COPY --chown=node:node . .