Skip to content

Commit

Permalink
Merge pull request #136 from humanmade/multiarch-docker
Browse files Browse the repository at this point in the history
Support multiarch builds
  • Loading branch information
roborourke authored Sep 1, 2021
2 parents 218ce65 + e3b4074 commit a030109
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docker-build.yml
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 }}
30 changes: 30 additions & 0 deletions Dockerfile.multiarch
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}

0 comments on commit a030109

Please sign in to comment.