Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -4
Dockerfile
CHANGED
@@ -3,15 +3,19 @@ FROM ${BASE} AS base
|
|
3 |
|
4 |
WORKDIR /app
|
5 |
|
6 |
-
#
|
|
|
|
|
|
|
|
|
7 |
RUN chown -R node:node /app
|
8 |
|
9 |
-
# Switch to the node user
|
10 |
USER node
|
11 |
|
12 |
-
# Install dependencies
|
13 |
COPY package.json pnpm-lock.yaml ./
|
14 |
-
RUN
|
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 . .
|