-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 867 Bytes
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 867 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
34
35
36
# ---- Base Node ----
FROM node:24 AS base
WORKDIR /app
COPY package*.json ./
# ---- Dependencies ----
FROM base AS dependencies
RUN npm install --force
# ---- Build ----
FROM dependencies AS build
COPY . .
RUN npm run build
# ---- Release ----
FROM node:24-alpine AS release
# Create app directory
WORKDIR /app
# Install curl for healthcheck and tini for proper signal handling
RUN apk add --no-cache curl tini
# Install app dependencies
COPY --from=dependencies /app/package*.json ./
RUN npm ci --omit=dev --ignore-scripts --force
# Bundle app source
COPY --from=build /app/dist ./dist
# Default port (configurable via PORT environment variable)
EXPOSE ${PORT:-3000}
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:${PORT:-3000}/status || exit 1
ENTRYPOINT ["/sbin/tini", "--", "node", "dist/cli.js"]