-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (24 loc) · 797 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (24 loc) · 797 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
FROM node:20-alpine AS builder
RUN mkdir -p /build && \
apk add --no-cache python3 make g++
WORKDIR /build
COPY package.json package-lock.json turbo.json .
COPY packages packages
RUN npm ci && \
npm run build && \
npm ci --only-production --workspace packages/backend
FROM node:20-alpine AS tini_fetcher
ENV TINI_VERSION=v0.19.0
RUN wget -O - https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static > /tini && \
chmod 755 /tini
FROM node:20-alpine
RUN mkdir -p /opt/app
WORKDIR /opt/app
COPY --from=tini_fetcher /tini /tini
COPY --from=builder /build/node_modules node_modules
COPY --from=builder /build/packages/backend .
COPY --from=builder /build/packages/web-client/dist public
EXPOSE 3001
USER node
CMD ["node", "start.mjs"]
ENTRYPOINT ["/tini", "--"]