-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdockerfile
More file actions
30 lines (25 loc) · 794 Bytes
/
dockerfile
File metadata and controls
30 lines (25 loc) · 794 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
27
28
29
30
# Build container
FROM node:current-alpine AS builder
COPY . ./
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN npm i -g pnpm
RUN pnpm i --frozen-lockfile
RUN pnpm prisma generate
RUN pnpm run build
# Deployment container
FROM node:current-alpine AS deployment
# Copy stuff from build container to ensure we have prisma and everything it needs
COPY --from=builder /.output /
COPY --from=builder /package.json /
COPY --from=builder /pnpm-lock.yaml /
COPY --from=builder /prisma.config.ts /
COPY --from=builder /prisma /prisma
COPY --from=builder /node_modules /node_modules
RUN npm i -g pnpm
COPY ./entrypoint.sh /entrypoint.sh
# Esnure we can actually run the entrypoint script
RUN chmod +x /entrypoint.sh
EXPOSE 3000
ENTRYPOINT ["/entrypoint.sh"]
CMD ["node", "./server/index.mjs"]