-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (31 loc) · 1.11 KB
/
Dockerfile
File metadata and controls
40 lines (31 loc) · 1.11 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
FROM node:20-bookworm-slim AS build
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends openssl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY server/package*.json server/
COPY web/package*.json web/
RUN npm --prefix server install
RUN npm --prefix web install
COPY server server
COPY web web
RUN npm --prefix server run prisma:generate
RUN npm --prefix web run build
RUN npm --prefix server run build
FROM node:20-bookworm-slim
WORKDIR /app
ENV NODE_ENV=production
RUN apt-get update \
&& apt-get install -y --no-install-recommends openssl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /app/server/dist /app/server/dist
COPY --from=build /app/server/package.json /app/server/package.json
COPY --from=build /app/server/node_modules /app/server/node_modules
COPY --from=build /app/server/prisma /app/server/prisma
COPY --from=build /app/server/entrypoint.sh /app/server/entrypoint.sh
COPY --from=build /app/web/dist /app/web/dist
EXPOSE 4000
WORKDIR /app/server
STOPSIGNAL SIGTERM
RUN chmod +x /app/server/entrypoint.sh
CMD ["/bin/sh", "/app/server/entrypoint.sh"]