From 9a73da56e9f1638a5d8b3729e46eb171036215ad Mon Sep 17 00:00:00 2001 From: diced Date: Sat, 18 Sep 2021 20:10:22 -0700 Subject: [PATCH] feat(docker): add arm64 compatible images --- .github/workflows/docker.yml | 17 +++++++++++++++++ Dockerfile.arm | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Dockerfile.arm diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 242e3f9..dfceee4 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,6 +27,23 @@ jobs: dockerfile: Dockerfile tag_with_ref: true + push_arm_to_ghcr: + name: Push arm64 Image to GitHub Packages + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Push to GitHub Packages + uses: docker/build-push-action@v1 + with: + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + registry: docker.pkg.github.com + repository: diced/zipline/zipline-arm + dockerfile: Dockerfile.arm + tag_with_ref: true + push_to_dockerhub: name: Push Image to Docker Hub runs-on: ubuntu-latest diff --git a/Dockerfile.arm b/Dockerfile.arm new file mode 100644 index 0000000..55ee488 --- /dev/null +++ b/Dockerfile.arm @@ -0,0 +1,33 @@ +FROM arm64v8/node:16-alpine3.11 AS builder +WORKDIR /build + +ENV NEXT_TELEMETRY_DISABLED=1 + +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"] \ No newline at end of file