2022-02-19 23:17:02 -05:00
|
|
|
FROM node:16-alpine AS deps
|
2021-06-23 13:20:20 -05:00
|
|
|
WORKDIR /build
|
|
|
|
|
2022-02-19 23:17:02 -05:00
|
|
|
COPY package.json yarn.lock ./
|
2021-09-17 22:39:20 -05:00
|
|
|
|
2022-02-19 23:17:02 -05:00
|
|
|
RUN apk add --no-cache libc6-compat
|
|
|
|
RUN yarn install --frozen-lockfile
|
|
|
|
|
|
|
|
FROM node:16-alpine AS builder
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
COPY --from=deps /build/node_modules ./node_modules
|
2021-06-23 13:20:20 -05:00
|
|
|
COPY src ./src
|
|
|
|
COPY scripts ./scripts
|
2021-08-25 17:16:39 -05:00
|
|
|
COPY prisma ./prisma
|
2022-03-03 01:04:56 -05:00
|
|
|
COPY package.json yarn.lock esbuild.config.js next.config.js next-env.d.ts zip-env.d.ts tsconfig.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-02-19 23:17:02 -05:00
|
|
|
FROM node:16-alpine AS runner
|
2021-06-23 13:20:20 -05:00
|
|
|
WORKDIR /zipline
|
|
|
|
|
2022-02-19 23:17:02 -05:00
|
|
|
ENV NODE_ENV production
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
|
|
|
|
|
|
RUN addgroup --system --gid 1001 zipline
|
|
|
|
RUN adduser --system --uid 1001 zipline
|
2021-06-23 13:20:20 -05:00
|
|
|
|
2022-02-19 23:17:02 -05:00
|
|
|
COPY --from=builder --chown=zipline:zipline /build/.next ./.next
|
2022-03-03 01:04:56 -05:00
|
|
|
COPY --from=builder --chown=zipline:zipline /build/dist ./dist
|
2022-02-19 23:17:02 -05:00
|
|
|
COPY --from=builder --chown=zipline:zipline /build/node_modules ./node_modules
|
|
|
|
|
|
|
|
COPY --from=builder /build/next.config.js ./next.config.js
|
2021-06-23 13:20:20 -05:00
|
|
|
COPY --from=builder /build/src ./src
|
|
|
|
COPY --from=builder /build/scripts ./scripts
|
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-02-19 23:17:02 -05:00
|
|
|
USER zipline
|
|
|
|
|
2022-03-03 01:04:56 -05:00
|
|
|
CMD ["node", "dist/server"]
|