-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (26 loc) · 807 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (26 loc) · 807 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
# Build stage
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Production stage
FROM node:22-alpine AS production
WORKDIR /app
RUN apk add --no-cache python3 make g++ && \
addgroup -g 1001 libscope && \
adduser -u 1001 -G libscope -s /bin/sh -D libscope
COPY package*.json ./
RUN npm ci --omit=dev --ignore-scripts && \
npm rebuild better-sqlite3 && \
apk del python3 make g++
COPY --from=builder /app/dist ./dist
USER libscope
EXPOSE 3420 3421
ENV LIBSCOPE_DATA_DIR=/data
VOLUME ["/data"]
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s \
CMD node -e "fetch('http://localhost:3420/api/v1/stats').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
ENTRYPOINT ["node", "dist/cli/index.js"]
CMD ["serve"]