-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 1.04 KB
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
# ── Build stage ────────────────────────────────────────────────────────────────
FROM node:20-alpine AS base
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY src ./src
# ── Runtime ────────────────────────────────────────────────────────────────────
FROM node:20-alpine AS runtime
WORKDIR /app
RUN addgroup -S stellar && adduser -S stellar -G stellar
RUN mkdir -p /app/data && chown stellar:stellar /app/data
COPY --from=base /app/node_modules ./node_modules
COPY --from=base /app/src ./src
COPY package.json ./
USER stellar
ENV NODE_ENV=production
ENV PORT=3000
ENV DB_PATH=/app/data/stellar-notify.db
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
CMD wget -qO- http://localhost:3000/api/health || exit 1
CMD ["node", "src/index.js"]