forked from heyform/heyform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
39 lines (29 loc) · 1.19 KB
/
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
FROM node:18.20.0-alpine3.19 as base
ARG APP_PATH=/app
WORKDIR $APP_PATH
RUN npm install -g pnpm
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
COPY package.json $APP_PATH/package.json
COPY pnpm-lock.yaml $APP_PATH/pnpm-lock.yaml
COPY pnpm-workspace.yaml $APP_PATH/pnpm-workspace.yaml
COPY packages/server $APP_PATH/packages/server
COPY packages/webapp $APP_PATH/packages/webapp
RUN pnpm install
RUN pnpm build
RUN pnpm --filter ./packages/webapp export
FROM node:18.20.0-alpine3.19 as runner
ARG APP_PATH=/app
WORKDIR $APP_PATH
RUN npm install -g pnpm
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
COPY --from=base $APP_PATH/packages/server/dist ./dist
COPY --from=base $APP_PATH/packages/server/mongoose ./mongoose
COPY --from=base $APP_PATH/packages/server/resources ./resources
COPY --from=base $APP_PATH/packages/server/static ./static
COPY --from=base $APP_PATH/packages/server/view ./view
COPY --from=base $APP_PATH/packages/server/.mongooserc.js ./.mongooserc.js
COPY --from=base $APP_PATH/packages/server/tsconfig.json ./tsconfig.json
COPY --from=base $APP_PATH/packages/server/package.json ./package.json
RUN pnpm install --prod
EXPOSE 8000
CMD ["pnpm", "start"]