-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (43 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
56 lines (43 loc) · 1.18 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
FROM node:24-alpine AS web
USER node
WORKDIR /home/node
COPY package*.json .npmrc ./
COPY --chown=node web/package.json web/
RUN --mount=type=cache,target=/root/.npm \
npm \
--ignore-scripts \
--include-workspace-root \
--no-fund \
--workspace web \
ci
COPY --chown=node web/ web/
RUN npm --workspace web run build
FROM node:24-alpine AS deps
USER node
WORKDIR /home/node
COPY package*.json .npmrc ./
COPY --chown=node api/package.json api/
RUN --mount=type=cache,target=/root/.npm \
npm \
--ignore-scripts \
--include-workspace-root \
--no-fund \
--omit dev \
--workspace api \
ci
FROM node:24-alpine
RUN apk add --no-cache curl tini
USER node
WORKDIR /home/node
COPY package*.json .npmrc ./
COPY api/ api/
# Enable below instruction if required
# COPY --from=deps /home/node/api/node_modules/ api/node_modules/
COPY --from=web /home/node/api/static api/static/
COPY bin/start.sh bin/
COPY --from=deps /home/node/node_modules node_modules/
EXPOSE 80
ENV PORT=80
HEALTHCHECK --start-period=10s --timeout=5s \
CMD curl --fail --header 'Container-Healthcheck: true' --show-error --silent "http://localhost:$PORT/healthz" || exit 1
ENTRYPOINT [ "/home/node/bin/start.sh" ]