-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #136 from humanmade/multiarch-docker
Support multiarch builds
- Loading branch information
Showing
2 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Docker Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
release: | ||
types: [released] | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
jobs: | ||
docker: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: humanmade/tachyon | ||
tags: | | ||
type=edge,branch=master | ||
type=ref,event=tag | ||
type=ref,event=pr | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build and push latest | ||
uses: docker/build-push-action@v2 | ||
with: | ||
file: Dockerfile.multiarch | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM node:14-alpine | ||
|
||
# Install build base | ||
RUN apk --update add --no-cache \ | ||
# --repository https://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||
--virtual build-deps fftw-dev gcc g++ make libc6-compat python | ||
RUN apk --update add --no-cache \ | ||
# --repository https://dl-cdn.alpinelinux.org/alpine/edge/community \ | ||
vips-dev | ||
|
||
# Get app | ||
COPY ./ /srv/tachyon/ | ||
WORKDIR /srv/tachyon | ||
RUN rm -rf node_modules | ||
RUN npm install aws-sdk | ||
RUN npm install --production | ||
|
||
# Clean up | ||
RUN apk del build-deps | ||
|
||
# Enable env vars | ||
ARG AWS_REGION | ||
ARG AWS_S3_BUCKET | ||
ARG AWS_S3_ENDPOINT | ||
ARG PORT | ||
ARG DEBUG=0 | ||
|
||
# Start the server | ||
EXPOSE ${PORT:-8080} | ||
CMD (($DEBUG)) && node server.js ${PORT:-8080} --debug || node server.js ${PORT:-8080} |