-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
22 lines (20 loc) · 941 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM node:22.5.1-alpine3.20 AS build
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable pnpm
WORKDIR /drap
COPY pnpm-lock.yaml .
RUN pnpm fetch
COPY . .
RUN pnpm install --recursive --offline
RUN pnpm --filter=drap-email --prod deploy /prod/email && pnpm --filter=drap-app --prod deploy /prod/app
RUN pnpm --parallel --recursive build && mv email/dist/ /prod/email && mv app/build/ /prod/app
FROM gcr.io/distroless/nodejs22-debian12:nonroot-amd64 AS deploy
COPY --from=build /prod/ ~/drap/
EXPOSE 3000
# This is the command to start the SvelteKit server. The background email worker
# should be spawned as a separate process somehow. When deploying to Fly.io
# (see the fly.toml), we use Process Groups to spawn both the main SvelteKit
# server and the email worker at the same time. For the sake of supplying a
# # default entry point, the following `CMD` starts the SvelteKit server.
CMD ["~/drap/app/build/index.js"]