zipline/Dockerfile

65 lines
2.1 KiB
Text
Raw Normal View History

2023-01-14 15:25:36 -08:00
FROM ghcr.io/diced/prisma-binaries:4.8.x as prisma
FROM node:alpine3.16 AS deps
RUN mkdir -p /prisma-engines
2021-06-23 11:20:20 -07:00
WORKDIR /build
COPY .yarn .yarn
COPY package.json yarn.lock .yarnrc.yml ./
2021-09-17 20:39:20 -07:00
RUN yarn install --immutable
FROM node:alpine3.16 AS builder
WORKDIR /build
2022-06-25 00:01:23 +00:00
COPY --from=prisma /prisma-engines /prisma-engines
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
RUN apk add --no-cache openssl openssl-dev
COPY --from=deps /build/node_modules ./node_modules
2021-06-23 11:20:20 -07:00
COPY src ./src
COPY prisma ./prisma
COPY .yarn .yarn
2023-01-06 15:08:18 -08:00
COPY package.json yarn.lock .yarnrc.yml tsup.config.ts next.config.js next-env.d.ts zip-env.d.ts tsconfig.json mimes.json ./
2021-06-23 11:20:20 -07:00
ENV ZIPLINE_DOCKER_BUILD 1
ENV NEXT_TELEMETRY_DISABLED 1
2022-02-12 20:35:36 -08:00
2021-06-23 11:20:20 -07:00
RUN yarn build
FROM node:alpine3.16 AS runner
2021-06-23 11:20:20 -07:00
WORKDIR /zipline
2022-06-25 00:01:23 +00:00
COPY --from=prisma /prisma-engines /prisma-engines
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
RUN apk add --no-cache openssl openssl-dev
2022-12-02 17:35:47 -08:00
RUN apk add --no-cache perl procps
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
COPY --from=builder /build/.next ./.next
COPY --from=builder /build/node_modules ./node_modules
COPY --from=builder /build/next.config.js ./next.config.js
2023-01-06 15:08:18 -08:00
COPY --from=builder /build/tsup.config.ts ./tsup.config.ts
2021-06-23 11:20:20 -07:00
COPY --from=builder /build/src ./src
2022-10-22 14:23:23 -07:00
COPY --from=builder /build/dist ./dist
COPY --from=builder /build/prisma ./prisma
2021-06-23 11:20:20 -07:00
COPY --from=builder /build/tsconfig.json ./tsconfig.json
COPY --from=builder /build/package.json ./package.json
2022-07-15 21:27:01 +00:00
COPY --from=builder /build/mimes.json ./mimes.json
2021-06-23 11:20:20 -07:00
2023-01-06 14:45:48 -08:00
CMD ["node", "--enable-source-maps", "dist"]