We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61f23e4 commit 7c296e9Copy full SHA for 7c296e9
template/Dockerfile
@@ -1,14 +1,32 @@
1
-FROM node:22-alpine
2
-
3
-ENV NODE_ENV=production
+FROM node:22 as build
4
5
-RUN mkdir /app
6
WORKDIR /app
7
8
COPY package*.json ./
9
10
-RUN npm install --production --legacy-peer-deps
+RUN npm ci --legacy-peer-deps
11
12
COPY . .
13
+# Build
+RUN npm run build
+
14
+# -------------------
15
+FROM node:22-alpine
16
17
+WORKDIR /app
18
19
+ENV NODE_ENV=production
20
21
+# Copy source
22
+COPY . .
23
24
+# Copy built files
25
+COPY --from=build /app/dist .
26
27
+# Build and cleanup
28
29
+RUN npm ci --omit=dev --legacy-peer-deps
30
31
+# Start server
32
CMD ["node", "node_modules/moleculer/bin/moleculer-runner.js"]
0 commit comments