Skip to content

Commit

Permalink
Multiplatform image
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbarratt committed Mar 5, 2024
1 parent bbaaf40 commit 9995fdc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,24 @@ jobs:
needs: [static]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/metadata-action@v5
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/${{ github.repository }}
- uses: docker/build-push-action@v5
id: build
with:
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${GITHUB_REPOSITORY}
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ github.repository }}
labels: ${{ steps.meta.outputs.labels }}
# - uses: azure/setup-kubectl@v1
# with:
Expand Down
18 changes: 12 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
FROM node:lts-alpine
ARG BASE="node:lts-alpine"

LABEL org.opencontainers.image.source https://github.com/chickaree/web

EXPOSE 80

ENV PORT 80
FROM --platform=$BUILDPLATFORM ${BASE} AS builder

COPY . /app

Expand All @@ -13,4 +9,14 @@ WORKDIR /app
RUN npm install --unsafe-perm --verbose; \
npm run build;

FROM ${BASE} AS server

EXPOSE 80

ENV PORT 80

COPY --from=builder /app /app

WORKDIR /app

CMD npm start;

0 comments on commit 9995fdc

Please sign in to comment.