2022-04-30 10:58:17 +00:00
|
|
|
FROM node:lts-alpine as dependencies
|
2022-03-07 12:43:34 +00:00
|
|
|
|
|
|
|
RUN apk add --no-cache curl g++ make python3 \
|
|
|
|
&& curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY package.json pnpm-*.yaml ./
|
|
|
|
COPY ./schema/package.json ./schema/package.json
|
|
|
|
COPY ./client/package.json ./client/package.json
|
|
|
|
|
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
|
2022-04-30 10:58:17 +00:00
|
|
|
FROM node:lts-alpine as builder
|
2022-03-07 12:43:34 +00:00
|
|
|
|
|
|
|
RUN apk add --no-cache curl g++ make python3 \
|
|
|
|
&& curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
COPY --from=dependencies /app/node_modules ./node_modules
|
|
|
|
COPY --from=dependencies /app/schema/node_modules ./schema/node_modules
|
|
|
|
COPY --from=dependencies /app/client/node_modules ./client/node_modules
|
|
|
|
|
|
|
|
RUN pnpm run build:schema
|
|
|
|
RUN pnpm run build:client
|
|
|
|
|
2022-04-30 10:58:17 +00:00
|
|
|
FROM node:lts-alpine as production
|
2022-03-07 12:43:34 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
RUN apk add --no-cache curl \
|
|
|
|
&& curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
|
|
|
|
|
2022-03-08 21:57:47 +00:00
|
|
|
COPY --from=builder /app/pnpm-*.yaml ./
|
|
|
|
COPY --from=builder /app/package.json ./
|
2022-03-09 17:55:17 +00:00
|
|
|
COPY --from=builder /app/client/package.json ./client/package.json
|
|
|
|
|
|
|
|
RUN pnpm install -F client --frozen-lockfile --prod
|
|
|
|
|
2022-03-07 12:43:34 +00:00
|
|
|
COPY --from=builder /app/client/.next ./client/.next
|
|
|
|
COPY --from=builder /app/client/public ./client/public
|
|
|
|
COPY --from=builder /app/client/next.config.js ./client/next.config.js
|
|
|
|
COPY --from=builder /app/client/next-i18next.config.js ./client/next-i18next.config.js
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
2022-03-07 22:52:39 +00:00
|
|
|
ENV PORT 3000
|
|
|
|
|
2022-03-23 22:52:30 +00:00
|
|
|
HEALTHCHECK --interval=30s --timeout=20s --retries=3 --start-period=15s \
|
|
|
|
CMD curl -fSs 127.0.0.1:3000 || exit 1
|
|
|
|
|
2022-03-07 12:43:34 +00:00
|
|
|
CMD [ "pnpm", "run", "start:client" ]
|