forked from stellarkit-lab-devtools/stellarkit-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (21 loc) · 665 Bytes
/
Copy pathDockerfile
File metadata and controls
33 lines (21 loc) · 665 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
# Production stage
FROM node:20-alpine AS production
WORKDIR /app
RUN addgroup -g 1001 -S nodejs && \
adduser -S stellarkit -u 1001
COPY package*.json ./
RUN npm ci --production && \
npm cache clean --force
COPY --from=builder --chown=stellarkit:nodejs /app/src ./src
COPY --from=builder --chown=stellarkit:nodejs /app/types ./types
USER stellarkit
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
CMD ["node", "src/index.js"]