-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (36 loc) · 1.24 KB
/
Copy pathDockerfile
File metadata and controls
41 lines (36 loc) · 1.24 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
33
34
35
36
37
38
39
40
41
FROM node:22-bookworm-slim AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
FROM node:22-bookworm-slim AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates libicu72 unzip \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev --ignore-scripts
COPY --from=build /app/dist ./dist
COPY web ./web
COPY examples/clean-branch.ink ./examples/clean-branch.ink
ENV HOME=/opt/inkcheck
RUN mkdir -p /opt/inkcheck \
&& node dist/cli.js examples/clean-branch.ink --json \
&& rm -rf examples \
&& chmod -R a=rX /opt/inkcheck \
&& apt-get purge -y unzip \
&& apt-get autoremove -y \
&& rm -rf /var/lib/apt/lists/*
ENV HOME=/home/node \
HOST=0.0.0.0 \
PORT=8080 \
NODE_ENV=production \
INKLECATE_PATH=/opt/inkcheck/.cache/inkcheck/inklecate-1.2.1/inklecate
RUN mkdir -p /var/lib/inkcheck && chown node:node /var/lib/inkcheck
USER node
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
CMD node -e "fetch('http://127.0.0.1:8080/healthz').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"
CMD ["node", "dist/web.js"]