File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change 1
1
# Stage 1: Build the Vue.js application
2
- FROM node:14 as build-stage
2
+ FROM node:14 AS build-stage
3
+
4
+ USER node
3
5
WORKDIR /app
4
- COPY package*.json ./
6
+
7
+ COPY --chown=1000:1000 package*.json ./
5
8
RUN npm install
6
- COPY . .
9
+ COPY --chown=1000:1000 . .
7
10
# this will tokenize the app
8
11
RUN npm run build
9
12
10
13
# Stage 2: Prepare the Node.js API
11
- FROM node:14 as api-stage
14
+ FROM node:14 AS api-stage
12
15
WORKDIR /api
13
16
# Copy package.json and other necessary files for the API
14
- COPY api/package*.json ./
15
- RUN npm install
17
+ COPY --chown=1000:1000 api/package*.json ./
18
+ RUN npm install \
19
+ && chown -R 1000:1000 /api
20
+
16
21
# Copy the rest of your API source code
17
22
COPY --chown=1000:1000 api/ .
18
23
@@ -28,4 +33,6 @@ EXPOSE 3000
28
33
29
34
# Command to run your API (and serve your Vue.js app)
30
35
RUN chmod +x /api/docker-entrypoint.api/entrypoint.sh
36
+
37
+ USER node
31
38
ENTRYPOINT ["/api/docker-entrypoint.api/entrypoint.sh" ]
You can’t perform that action at this time.
0 commit comments