diff --git a/.github/workflows/base-images.yml b/.github/workflows/base-images.yml new file mode 100644 index 0000000..d756380 --- /dev/null +++ b/.github/workflows/base-images.yml @@ -0,0 +1,48 @@ +name: Publish base Docker images + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + strategy: + matrix: + nodejs: [10, 12, 14] + steps: + - + name: Checkout + uses: actions/checkout@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v1 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - + name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.CR_PAT }} + - + name: Publish thumbsup/runtime + uses: docker/build-push-action@v2 + with: + context: docker + file: ./docker/Dockerfile.runtime + build-args: NODE_VERSION=${{ matrix.nodejs }} + platforms: linux/amd64,linux/arm64 + tags: ghcr.io/thumbsup/runtime:node-${{ matrix.nodejs }} + push: true + - + name: Publish thumbsup/build + uses: docker/build-push-action@v2 + with: + context: docker + file: ./docker/Dockerfile.build + build-args: NODE_VERSION=${{ matrix.nodejs }} + platforms: linux/amd64,linux/arm64 + tags: ghcr.io/thumbsup/build:node-${{ matrix.nodejs }} + push: true diff --git a/docker/Dockerfile.build b/docker/Dockerfile.build new file mode 100644 index 0000000..5cd93fb --- /dev/null +++ b/docker/Dockerfile.build @@ -0,0 +1,19 @@ +# ------------------------------------------------- +# This Docker image is used to speed up the builds +# ------------------------------------------------- + +ARG NODE_VERSION + +# Node.js + runtime dependencies +FROM ghcr.io/thumbsup/runtime:node-${NODE_VERSION} + +# Metadata +LABEL org.opencontainers.image.source https://github.com/thumbsup/thumbsup + +# Standard build dependencies for npm install +RUN apk add --no-cache git make g++ python bash + +# Pre-install expensive dependencies +WORKDIR /app +RUN npm init -y +RUN npm install better-sqlite3 diff --git a/docker/Dockerfile.runtime b/docker/Dockerfile.runtime new file mode 100644 index 0000000..c041bfe --- /dev/null +++ b/docker/Dockerfile.runtime @@ -0,0 +1,17 @@ +# ------------------------------------------------- +# This Docker image contains all the typical +# runtime dependencies for thumbsup, including +# exiftool, imagemagick, ffmpeg, gifsicle... +# ------------------------------------------------- + +ARG NODE_VERSION +FROM node:${NODE_VERSION}-alpine as base + +# Metadata +LABEL org.opencontainers.image.source https://github.com/thumbsup/thumbsup + +# Add libraries +RUN apk add --update --no-cache libgomp zlib libpng libjpeg-turbo libwebp tiff lcms2 x265 libde265 libheif + +# Add external programs +RUN apk add --update --no-cache ffmpeg imagemagick graphicsmagick exiftool gifsicle zip