diff --git a/.github/workflows/post-release-push-images.yml b/.github/workflows/post-release-push-images.yml index 145ebfdf2..818b5fff9 100644 --- a/.github/workflows/post-release-push-images.yml +++ b/.github/workflows/post-release-push-images.yml @@ -17,16 +17,22 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} persist-credentials: true + - name: Set up QEMU (for multi-arch builds) + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Log in to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - # All-in-one Image Steps + # All-in-one Image Steps (multi-arch: amd64 + arm64) - name: Extract metadata (tags, labels) for All-in-one Docker id: meta_all_in_one - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: daveearley/hi.events-all-in-one tags: | @@ -34,13 +40,16 @@ jobs: type=raw,value=latest,enable=${{ github.event.release.prerelease == false }} - name: Build and push All-in-one Docker image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v5 with: context: ./ file: ./Dockerfile.all-in-one + platforms: linux/amd64,linux/arm64 push: true tags: ${{ steps.meta_all_in_one.outputs.tags }} labels: ${{ steps.meta_all_in_one.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max # Backend Image Steps - name: Extract metadata (tags, labels) for Backend Docker diff --git a/Dockerfile.all-in-one b/Dockerfile.all-in-one index c5377aa15..8e5ff472a 100644 --- a/Dockerfile.all-in-one +++ b/Dockerfile.all-in-one @@ -4,19 +4,26 @@ WORKDIR /app/frontend RUN apk add --no-cache yarn +# Increase network timeout for slow ARM emulation builds +RUN yarn config set network-timeout 600000 + COPY ./frontend/package.json ./frontend/yarn.lock ./ COPY ./frontend . -RUN yarn install && yarn build +RUN yarn install --network-timeout 600000 --frozen-lockfile && yarn build -FROM serversideup/php:beta-8.3.2-fpm-alpine +# Use stable multi-arch serversideup/php image +FROM serversideup/php:8.3-fpm-alpine ENV PHP_OPCACHE_ENABLE=1 +# Switch to root for installing extensions and packages +USER root + RUN install-php-extensions intl -RUN apk add --no-cache nodejs yarn nginx supervisor +RUN apk add --no-cache nodejs yarn nginx supervisor dos2unix COPY --from=node-frontend /app/frontend /app/frontend