diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c718d2c..a7d7568 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,5 +42,6 @@ jobs: - name: Build and push uses: docker/build-push-action@v3 with: - push: true + push: ${{ github.ref == 'refs/heads/main' }} tags: streamr/stream-metrics-index:latest + platforms: linux/amd64,linux/arm64 diff --git a/Dockerfile b/Dockerfile index 59c6c70..1216d1f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN npm run build RUN chmod +x dist/bin/*.js RUN rm -rf node_modules -FROM node:18-bullseye-slim +FROM node:18-bullseye USER node WORKDIR /usr/src/app COPY --chown=node:node --from=build /usr/src/app/ . diff --git a/package.json b/package.json index a461af6..b95da33 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,8 @@ "private": true, "scripts": { "build": "tsc -b tsconfig.build.json", + "docker:build": "docker build --tag streamr/stream-metrics-index:latest .", + "docker:push": "docker buildx build --platform linux/amd64,linux/arm64 --tag streamr/stream-metrics-index:latest --push .", "test": "jest --runInBand", "eslint": "eslint --cache --cache-location=node_modules/.cache/.eslintcache/ '*/**/*.{js,ts}'" },