-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
38 lines (25 loc) · 900 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
FROM node:20 AS builder
WORKDIR /app
COPY . .
RUN corepack enable
RUN corepack prepare [email protected] --activate
ARG INSTALL_DEV=false
RUN pnpm --version
RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then pnpm install --frozen-lockfile ; else pnpm install --frozen-lockfile --production ; fi"
RUN pnpm build
FROM node:20-alpine AS runner
WORKDIR /app
RUN apk add --no-cache bash
RUN corepack enable
RUN corepack prepare [email protected] --activate
COPY --from=builder /app/package.json /app/package.json
COPY --from=builder /app/types/ /app/types/
COPY --from=builder /app/src/ /app/src/
COPY --from=builder /app/tailwind.config.ts /app/tailwind.config.ts
COPY --from=builder /app/tsconfig.json /app/tsconfig.json
COPY --from=builder /app/etc /app/etc
COPY --from=builder /app/build /app/build
COPY --from=builder /app/node_modules /app/node_modules
EXPOSE 3000
EXPOSE 3002
CMD [ "pnpm", "dev" ]