zipline/Dockerfile.arm
2021-09-18 21:28:24 -07:00

60 lines
No EOL
1.6 KiB
Text

FROM arm64v8/rust:1-alpine AS engine
ENV USER root
RUN apk add openssl git
ENV WORKSPACE_ROOT=/engine
ENV RUST_LOG_FORMAT=devel
ENV RUST_BACKTRACE=1
ENV RUST_LOG=query_engine=debug,quaint=debug,query_core=debug,query_connector=debug,sql_query_connector=debug,prisma_models=debug,engineer=debug
ENV PATH="/root/.cargo/bin:${PATH}"
RUN git clone https://github.com/prisma/prisma-engines.git /engine
WORKDIR /engine
RUN cargo --release
FROM arm64v8/node:16-alpine3.11 AS builder
WORKDIR /build
COPY --from=engine /engine/target/release/query-engine ./
COPY --from=engine /engine/target/release/migration-engine ./
COPY --from=engine /engine/target/release/introspection-engine ./
ENV NEXT_TELEMETRY_DISABLED=1
ENV PRISMA_QUERY_ENGINE_BINARY=query-engine
ENV PRISMA_MIGRATION_ENGINE_BINARY=migration-engine
ENV PRISMA_INTROSPECTION_ENGINE_BINARY=introspection-engine
RUN apk add openssl
COPY src ./src
COPY server ./server
COPY scripts ./scripts
COPY prisma ./prisma
COPY package.json yarn.lock next.config.js next-env.d.ts zip-env.d.ts tsconfig.json ./
RUN yarn install
# create a mock config.toml to spoof next build!
RUN echo -e "[uploader]\nroute = '/u'" > config.toml
RUN yarn build
FROM arm64v8/node:16-alpine3.11 AS runner
WORKDIR /zipline
COPY --from=builder /build/node_modules ./node_modules
COPY --from=builder /build/src ./src
COPY --from=builder /build/server ./server
COPY --from=builder /build/scripts ./scripts
COPY --from=builder /build/prisma ./prisma
COPY --from=builder /build/.next ./.next
COPY --from=builder /build/tsconfig.json ./tsconfig.json
COPY --from=builder /build/package.json ./package.json
CMD ["node", "server"]