Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,30 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# 👆 This is needed ARM emulation on AMD64 runner

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# 👆 This is need for QEMU to work

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set lowercase repository name
run: |
echo "LOWERCASE_REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Extract metadata for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
images: ghcr.io/${{ env.LOWERCASE_REPO }}

- name: Build and push
uses: docker/build-push-action@v6
Expand All @@ -65,6 +77,6 @@ jobs:
file: ./docker/Dockerfile
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ github.sha }}
ghcr.io/${{ env.LOWERCASE_REPO }}:latest
ghcr.io/${{ env.LOWERCASE_REPO }}:${{ github.sha }}
labels: ${{ steps.meta.outputs.labels }}
13 changes: 11 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# Using 18 alpine because supports arm/v8 and arm/v8 needed for silicon chips
FROM node:18-alpine
RUN apk add --no-cache bash

# Builder stage with build tools - especially for node-gyp in arm64
FROM node:18-alpine AS builder
RUN apk add --no-cache bash python3 make g++
WORKDIR /app
ADD ./ .
RUN npm install
RUN npm run build

# Runtime stage - minimal
FROM node:18-alpine
RUN apk add --no-cache bash
WORKDIR /app
ADD ./ .
COPY --from=builder /app/node_modules /app/node_modules
CMD ["npm", "start"]