diff --git a/.github/workflows/build-images.reusable.yaml b/.github/workflows/build-images.reusable.yaml index c4c0dac93..3acab0a97 100644 --- a/.github/workflows/build-images.reusable.yaml +++ b/.github/workflows/build-images.reusable.yaml @@ -16,7 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - name: Set up Node.js uses: actions/setup-node@v3 @@ -27,16 +30,17 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.IOTALEDGER_DOCKER_USERNAME }} password: ${{ secrets.IOTALEDGER_DOCKER_PASSWORD }} - name: Build and push Docker image for ${{ inputs.directory }} - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: ./${{ inputs.directory }} file: ./${{ inputs.directory }}/Dockerfile + platforms: linux/amd64,linux/arm64 push: true tags: ${{ inputs.image_tags }} no-cache: true diff --git a/api/Dockerfile b/api/Dockerfile index 9d76f4658..345879e0f 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -13,7 +13,8 @@ COPY . ./ ARG CONFIG_ID # Install all packages necessary for compilation, build, then remove the devDependencies -RUN npm install +# Seems to fail for arm64 images if maxsockets is not set to 1. https://github.com/npm/cli/issues/4652#issuecomment-1157594100 +RUN npm install --maxsockets 1 RUN npm run build-compile RUN npm run build-config RUN npm prune --production diff --git a/client/Dockerfile b/client/Dockerfile index 76e53ed49..b6af428e2 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -25,7 +25,8 @@ RUN echo 'server {\ }' > /etc/nginx/sites-available/default # Running required steps to prepare the web app prod build -RUN npm install +# Seems to fail for arm64 images if maxsockets is not set to 1. https://github.com/npm/cli/issues/4652#issuecomment-1157594100 +RUN npm install --maxsockets 1 RUN npm run build # Expose port 80