File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed
Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -4,3 +4,4 @@ Dockerfile
44node_modules
55test
66.vscode
7+ data
Original file line number Diff line number Diff line change 1- FROM node:16-alpine
1+ FROM node:16 as build
22
3- RUN mkdir /app
4- WORKDIR /app
3+ WORKDIR /tmp/app
54
65# Install dependencies
76COPY package.json package-lock.json ./
@@ -10,10 +9,23 @@ RUN npm ci --silent
109# Copy source
1110COPY . .
1211
12+ # Build
13+ RUN npm run build
14+
15+ # -------------------
16+ FROM node:16-alpine
17+
18+ WORKDIR /app
19+
20+ # Copy source
21+ COPY . .
22+
23+ # Copy built files
24+ COPY --from=build /tmp/app/dist .
25+
1326# Build and cleanup
1427ENV NODE_ENV=production
15- RUN npm run build \
16- && npm prune
28+ RUN npm ci --omit=dev
1729
1830# Start server
19- CMD ["npm " , "start " ]
31+ CMD ["node " , "./node_modules/moleculer/bin/moleculer-runner.js " ]
Original file line number Diff line number Diff line change 11NAMESPACE =
22LOGGER = true
33LOGLEVEL = info
4- SERVICEDIR = dist/services
4+ SERVICEDIR = services
5+ MOLECULER_CONFIG = moleculer.config.js
56
67{{# if_eq transporter "NATS"}}
78TRANSPORTER = nats://nats:4222
You can’t perform that action at this time.
0 commit comments