-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
46 lines (30 loc) · 1008 Bytes
/
Dockerfile
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
# builder for server
FROM node:22-alpine as builder-server
LABEL author="Robert Jansen" maintainer="[email protected]"
USER root
RUN npm i -g pnpm --force
COPY ./package.json /app/server/package.json
COPY ./pnpm-lock.yaml /app/server/pnpm-lock.yaml
RUN cd /app/server && \
pnpm install --frozen-lockfile
COPY ./src /app/server/src
COPY ./tsconfig.json /app/server/tsconfig.json
RUN cd /app/server && \
pnpm build
RUN cd /app/server && \
pnpm prune --prod
# runner
FROM node:22-bookworm-slim as runner
LABEL author="Robert Jansen" maintainer="[email protected]"
RUN apt update && \
apt install -y git bash
COPY --from=builder-server /app/server/node_modules /app/server/node_modules
COPY --from=builder-server /app/server/lib /app/server/lib
USER root
COPY ./.git /app/.git
RUN git config --system --add safe.directory '*'
COPY ./entrypoint.sh /entrypoint.sh
COPY ./package.json /app/server/package.json
RUN mkdir /app/tmp
WORKDIR /app
CMD [ "/bin/bash", "/entrypoint.sh" ]