2022-07-25 20:40:55 +00:00
|
|
|
FROM node:18-alpine3.16 as build
|
2022-02-10 14:47:44 +00:00
|
|
|
WORKDIR /app
|
2022-04-11 20:31:27 +00:00
|
|
|
|
|
|
|
RUN apk add --no-cache curl
|
2022-07-06 09:02:36 +00:00
|
|
|
RUN curl -sL https://unpkg.com/@pnpm/self-installer | node
|
2022-04-11 20:31:27 +00:00
|
|
|
|
2022-07-06 09:02:36 +00:00
|
|
|
COPY . .
|
2022-04-11 20:31:27 +00:00
|
|
|
RUN pnpm install
|
2022-07-06 09:02:36 +00:00
|
|
|
RUN pnpm build
|
2022-02-10 14:47:44 +00:00
|
|
|
|
2022-07-06 09:02:36 +00:00
|
|
|
# Production build
|
2022-07-25 20:40:55 +00:00
|
|
|
FROM node:18-alpine3.16
|
2022-04-01 12:25:55 +00:00
|
|
|
WORKDIR /app
|
2022-07-06 09:02:36 +00:00
|
|
|
ENV NODE_ENV production
|
|
|
|
ARG TARGETPLATFORM
|
2022-04-01 12:25:55 +00:00
|
|
|
|
|
|
|
ENV PRISMA_QUERY_ENGINE_BINARY=/app/prisma-engines/query-engine \
|
|
|
|
PRISMA_MIGRATION_ENGINE_BINARY=/app/prisma-engines/migration-engine \
|
|
|
|
PRISMA_INTROSPECTION_ENGINE_BINARY=/app/prisma-engines/introspection-engine \
|
|
|
|
PRISMA_FMT_BINARY=/app/prisma-engines/prisma-fmt \
|
|
|
|
PRISMA_CLI_QUERY_ENGINE_TYPE=binary \
|
|
|
|
PRISMA_CLIENT_ENGINE_TYPE=binary
|
|
|
|
|
2022-08-29 13:42:18 +00:00
|
|
|
COPY --from=coollabsio/prisma-engine:4.2.0 /prisma-engines/query-engine /prisma-engines/migration-engine /prisma-engines/introspection-engine /prisma-engines/prisma-fmt /app/prisma-engines/
|
2022-04-01 12:25:55 +00:00
|
|
|
|
2022-08-12 07:38:11 +00:00
|
|
|
RUN apk add --no-cache git git-lfs openssh-client curl jq cmake sqlite openssl psmisc
|
2022-07-06 09:02:36 +00:00
|
|
|
RUN curl -sL https://unpkg.com/@pnpm/self-installer | node
|
|
|
|
|
2022-02-10 14:47:44 +00:00
|
|
|
RUN mkdir -p ~/.docker/cli-plugins/
|
2022-07-26 12:59:06 +00:00
|
|
|
# https://download.docker.com/linux/static/stable/
|
2022-04-01 12:25:55 +00:00
|
|
|
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-20.10.9 -o /usr/bin/docker
|
2022-07-26 12:59:06 +00:00
|
|
|
# https://github.com/docker/compose/releases
|
2022-08-17 11:30:53 +00:00
|
|
|
# Reverted to 2.6.1 because of this https://github.com/docker/compose/issues/9704. 2.9.0 still has a bug.
|
|
|
|
RUN curl -SL https://cdn.coollabs.io/bin/$TARGETPLATFORM/docker-compose-linux-2.6.1 -o ~/.docker/cli-plugins/docker-compose
|
2022-03-31 22:08:29 +00:00
|
|
|
RUN chmod +x ~/.docker/cli-plugins/docker-compose /usr/bin/docker
|
2022-02-10 14:47:44 +00:00
|
|
|
|
2022-08-11 13:04:34 +00:00
|
|
|
RUN (curl -sSL "https://github.com/buildpacks/pack/releases/download/v0.27.0/pack-v0.27.0-linux.tgz" | tar -C /usr/local/bin/ --no-same-owner -xzv pack)
|
|
|
|
|
2022-07-06 09:02:36 +00:00
|
|
|
COPY --from=build /app/apps/api/build/ .
|
|
|
|
COPY --from=build /app/apps/ui/build/ ./public
|
|
|
|
COPY --from=build /app/apps/api/prisma/ ./prisma
|
|
|
|
COPY --from=build /app/apps/api/package.json .
|
|
|
|
COPY --from=build /app/docker-compose.yaml .
|
2022-04-11 20:31:27 +00:00
|
|
|
|
2022-07-06 09:02:36 +00:00
|
|
|
RUN pnpm install -p
|
2022-04-11 20:31:27 +00:00
|
|
|
|
2022-02-10 14:47:44 +00:00
|
|
|
EXPOSE 3000
|
2022-08-29 13:42:18 +00:00
|
|
|
ENV CHECKPOINT_DISABLE=1
|
2022-07-06 09:02:36 +00:00
|
|
|
CMD pnpm start
|