2022-10-22 16:23:23 -05:00
|
|
|
FROM ghcr.io/diced/prisma-binaries:4.5.x as prisma
|
2022-06-24 13:27:35 -05:00
|
|
|
|
2022-10-29 12:52:27 -05:00
|
|
|
FROM node:alpine3.16 AS deps
|
2022-06-24 13:27:35 -05:00
|
|
|
RUN mkdir -p /prisma-engines
|
2021-06-23 13:20:20 -05:00
|
|
|
WORKDIR /build
|
|
|
|
|
2022-06-06 18:38:15 -05:00
|
|
|
COPY .yarn .yarn
|
|
|
|
COPY package.json yarn.lock .yarnrc.yml ./
|
2021-09-17 22:39:20 -05:00
|
|
|
|
2022-06-06 18:38:15 -05:00
|
|
|
RUN yarn install --immutable
|
2022-02-19 23:17:02 -05:00
|
|
|
|
2022-10-29 12:52:27 -05:00
|
|
|
FROM node:alpine3.16 AS builder
|
2022-02-19 23:17:02 -05:00
|
|
|
WORKDIR /build
|
|
|
|
|
2022-06-24 19:01:23 -05:00
|
|
|
COPY --from=prisma /prisma-engines /prisma-engines
|
2022-06-24 13:27:35 -05:00
|
|
|
ENV PRISMA_QUERY_ENGINE_BINARY=/prisma-engines/query-engine \
|
|
|
|
PRISMA_MIGRATION_ENGINE_BINARY=/prisma-engines/migration-engine \
|
|
|
|
PRISMA_INTROSPECTION_ENGINE_BINARY=/prisma-engines/introspection-engine \
|
|
|
|
PRISMA_FMT_BINARY=/prisma-engines/prisma-fmt \
|
|
|
|
PRISMA_CLI_QUERY_ENGINE_TYPE=binary \
|
|
|
|
PRISMA_CLIENT_ENGINE_TYPE=binary
|
|
|
|
|
2022-10-29 12:52:27 -05:00
|
|
|
RUN apk add --no-cache openssl openssl-dev
|
2022-06-21 00:29:33 -05:00
|
|
|
|
2022-02-19 23:17:02 -05:00
|
|
|
COPY --from=deps /build/node_modules ./node_modules
|
2021-06-23 13:20:20 -05:00
|
|
|
COPY src ./src
|
2021-08-25 17:16:39 -05:00
|
|
|
COPY prisma ./prisma
|
2022-06-06 18:38:15 -05:00
|
|
|
COPY .yarn .yarn
|
2022-07-15 16:27:01 -05:00
|
|
|
COPY package.json yarn.lock .yarnrc.yml esbuild.config.js next.config.js next-env.d.ts zip-env.d.ts tsconfig.json mimes.json ./
|
2021-06-23 13:20:20 -05:00
|
|
|
|
2022-02-19 23:17:02 -05:00
|
|
|
ENV ZIPLINE_DOCKER_BUILD 1
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
2022-02-12 23:35:36 -05:00
|
|
|
|
2021-06-23 13:20:20 -05:00
|
|
|
RUN yarn build
|
|
|
|
|
2022-10-29 12:52:27 -05:00
|
|
|
FROM node:alpine3.16 AS runner
|
2021-06-23 13:20:20 -05:00
|
|
|
WORKDIR /zipline
|
|
|
|
|
2022-06-24 19:01:23 -05:00
|
|
|
COPY --from=prisma /prisma-engines /prisma-engines
|
2022-06-24 13:27:35 -05:00
|
|
|
ENV PRISMA_QUERY_ENGINE_BINARY=/prisma-engines/query-engine \
|
|
|
|
PRISMA_MIGRATION_ENGINE_BINARY=/prisma-engines/migration-engine \
|
|
|
|
PRISMA_INTROSPECTION_ENGINE_BINARY=/prisma-engines/introspection-engine \
|
|
|
|
PRISMA_FMT_BINARY=/prisma-engines/prisma-fmt \
|
|
|
|
PRISMA_CLI_QUERY_ENGINE_TYPE=binary \
|
|
|
|
PRISMA_CLIENT_ENGINE_TYPE=binary
|
|
|
|
|
2022-10-29 12:52:27 -05:00
|
|
|
RUN apk add --no-cache openssl openssl-dev
|
2022-12-02 20:35:47 -05:00
|
|
|
RUN apk add --no-cache perl procps
|
2022-06-21 00:29:33 -05:00
|
|
|
|
2022-02-19 23:17:02 -05:00
|
|
|
ENV NODE_ENV production
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
|
|
|
2022-06-21 00:29:33 -05:00
|
|
|
COPY --from=builder /build/.next ./.next
|
|
|
|
COPY --from=builder /build/node_modules ./node_modules
|
2022-02-19 23:17:02 -05:00
|
|
|
|
|
|
|
COPY --from=builder /build/next.config.js ./next.config.js
|
2022-11-10 22:27:23 -05:00
|
|
|
COPY --from=builder /build/esbuild.config.js ./esbuild.config.js
|
2021-06-23 13:20:20 -05:00
|
|
|
COPY --from=builder /build/src ./src
|
2022-10-22 16:23:23 -05:00
|
|
|
COPY --from=builder /build/dist ./dist
|
2021-08-25 17:16:39 -05:00
|
|
|
COPY --from=builder /build/prisma ./prisma
|
2021-06-23 13:20:20 -05:00
|
|
|
COPY --from=builder /build/tsconfig.json ./tsconfig.json
|
|
|
|
COPY --from=builder /build/package.json ./package.json
|
2022-07-15 16:27:01 -05:00
|
|
|
COPY --from=builder /build/mimes.json ./mimes.json
|
2021-06-23 13:20:20 -05:00
|
|
|
|
2022-10-22 16:23:23 -05:00
|
|
|
CMD ["node", "--enable-source-maps", "dist/server"]
|