diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index f921be5..3d3dec5 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -14,17 +14,15 @@ on: dockerfile-path: type: string required: true + # secrets: + # GITHUB_TOKEN: + # required: false jobs: build: runs-on: ubuntu-latest steps: - - name: Check actor - shell: bash - run: | - echo "Actor: ${{ github.actor }}" && echo "Actor: ${{ secrets.GITHUB_TOKEN }}" - - uses: actions/checkout@v3 - name: 'Login to GitHub Container Registry' uses: docker/login-action@v2 diff --git a/.github/workflows/docker-image-wallet-enterprise-acme-verifier.yml b/.github/workflows/docker-image-wallet-enterprise-acme-verifier.yml new file mode 100644 index 0000000..fb53213 --- /dev/null +++ b/.github/workflows/docker-image-wallet-enterprise-acme-verifier.yml @@ -0,0 +1,21 @@ +name: Build Docker image +on: + push: + branches-ignore: + - dc4eu-rome + - master + pull_request: + +jobs: + build-acme: + permissions: + contents: read + packages: read + + uses: ./.github/workflows/docker-build-push.yml + # secrets: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + image-tag: ghcr.io/gunet/wallet-enterprise-acme-verifier:latest + docker-push: false + dockerfile-path: ./wallet-enterprise-configurations/acme-verifier/Dockerfile diff --git a/.github/workflows/docker-image-wallet-enterprise-ehic-issuer.yml b/.github/workflows/docker-image-wallet-enterprise-ehic-issuer.yml new file mode 100644 index 0000000..ddc0dac --- /dev/null +++ b/.github/workflows/docker-image-wallet-enterprise-ehic-issuer.yml @@ -0,0 +1,21 @@ +name: Build Docker image +on: + push: + branches-ignore: + - dc4eu-rome + - master + pull_request: + +jobs: + build-ehic: + permissions: + contents: read + packages: read + + uses: ./.github/workflows/docker-build-push.yml + # secrets: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + image-tag: ghcr.io/gunet/wallet-enterprise-ehic-issuer:latest + docker-push: false + dockerfile-path: ./wallet-enterprise-configurations/ehic-issuer/Dockerfile diff --git a/.github/workflows/docker-image-wallet-enterprise-pda1-issuer.yml b/.github/workflows/docker-image-wallet-enterprise-pda1-issuer.yml new file mode 100644 index 0000000..fba3cf5 --- /dev/null +++ b/.github/workflows/docker-image-wallet-enterprise-pda1-issuer.yml @@ -0,0 +1,21 @@ +name: Build Docker image +on: + push: + branches-ignore: + - dc4eu-rome + - master + pull_request: + +jobs: + build-pda1: + permissions: + contents: read + packages: read + + uses: ./.github/workflows/docker-build-push.yml + # secrets: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + image-tag: ghcr.io/gunet/wallet-enterprise-pda1-issuer:latest + docker-push: false + dockerfile-path: ./wallet-enterprise-configurations/pda1-issuer/Dockerfile diff --git a/.github/workflows/wallet-enterprise-vid-issuer/docker-image-wallet-enterprise-vid-issuer.yml b/.github/workflows/docker-image-wallet-enterprise-vid-issuer.yml similarity index 69% rename from .github/workflows/wallet-enterprise-vid-issuer/docker-image-wallet-enterprise-vid-issuer.yml rename to .github/workflows/docker-image-wallet-enterprise-vid-issuer.yml index 45a6321..25eafc6 100644 --- a/.github/workflows/wallet-enterprise-vid-issuer/docker-image-wallet-enterprise-vid-issuer.yml +++ b/.github/workflows/docker-image-wallet-enterprise-vid-issuer.yml @@ -3,6 +3,7 @@ on: push: branches-ignore: - dc4eu-rome + - master pull_request: jobs: @@ -11,8 +12,10 @@ jobs: contents: read packages: read - uses: gunet/wallet-ecosystem/.github/workflows/docker-build-push.yml@dc-workflow + uses: ./.github/workflows/docker-build-push.yml + # secrets: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: image-tag: ghcr.io/gunet/wallet-enterprise-vid-issuer:latest docker-push: false - dockerfile-path: ./wallet-enterprise-configurations/vid-issuer/Dockerfile \ No newline at end of file + dockerfile-path: ./wallet-enterprise-configurations/vid-issuer/Dockerfile diff --git a/.github/workflows/docker-push-wallet-enterprise-acme-verifier.yml b/.github/workflows/docker-push-wallet-enterprise-acme-verifier.yml new file mode 100644 index 0000000..ab2613f --- /dev/null +++ b/.github/workflows/docker-push-wallet-enterprise-acme-verifier.yml @@ -0,0 +1,21 @@ +name: Build Docker image +on: + push: + branches-ignore: + - dc4eu-rome + - master + pull_request: + +jobs: + push-acme: + permissions: + contents: read + packages: read + + uses: ./.github/workflows/docker-build-push.yml + # secrets: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + image-tag: ghcr.io/gunet/wallet-enterprise-acme-verifier:latest + docker-push: true + dockerfile-path: ./wallet-enterprise-configurations/acme-verifier/Dockerfile diff --git a/.github/workflows/docker-push-wallet-enterprise-ehic-issuer.yml b/.github/workflows/docker-push-wallet-enterprise-ehic-issuer.yml new file mode 100644 index 0000000..f0d1b3c --- /dev/null +++ b/.github/workflows/docker-push-wallet-enterprise-ehic-issuer.yml @@ -0,0 +1,21 @@ +name: Build Docker image +on: + push: + branches-ignore: + - dc4eu-rome + - master + pull_request: + +jobs: + push-ehic: + permissions: + contents: read + packages: read + + uses: ./.github/workflows/docker-build-push.yml + # secrets: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + image-tag: ghcr.io/gunet/wallet-enterprise-ehic-issuer:latest + docker-push: true + dockerfile-path: ./wallet-enterprise-configurations/ehic-issuer/Dockerfile diff --git a/.github/workflows/docker-push-wallet-enterprise-pda1-issuer.yml b/.github/workflows/docker-push-wallet-enterprise-pda1-issuer.yml new file mode 100644 index 0000000..ecffa7b --- /dev/null +++ b/.github/workflows/docker-push-wallet-enterprise-pda1-issuer.yml @@ -0,0 +1,21 @@ +name: Build Docker image +on: + push: + branches-ignore: + - dc4eu-rome + - master + pull_request: + +jobs: + push-pda1: + permissions: + contents: read + packages: read + + uses: ./.github/workflows/docker-build-push.yml + # secrets: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + image-tag: ghcr.io/gunet/wallet-enterprise-pda1-issuer:latest + docker-push: true + dockerfile-path: ./wallet-enterprise-configurations/pda1-issuer/Dockerfile diff --git a/.github/workflows/wallet-enterprise-vid-issuer/docker-push-wallet-enterprise-vid-issuer.yml b/.github/workflows/docker-push-wallet-enterprise-vid-issuer.yml similarity index 69% rename from .github/workflows/wallet-enterprise-vid-issuer/docker-push-wallet-enterprise-vid-issuer.yml rename to .github/workflows/docker-push-wallet-enterprise-vid-issuer.yml index 26b8310..5337a02 100644 --- a/.github/workflows/wallet-enterprise-vid-issuer/docker-push-wallet-enterprise-vid-issuer.yml +++ b/.github/workflows/docker-push-wallet-enterprise-vid-issuer.yml @@ -3,6 +3,7 @@ on: push: branches-ignore: - dc4eu-rome + - master pull_request: jobs: @@ -11,8 +12,10 @@ jobs: contents: read packages: read - uses: gunet/wallet-ecosystem/.github/workflows/docker-build-push.yml@dc-workflow + uses: ./.github/workflows/docker-build-push.yml + # secrets: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: image-tag: ghcr.io/gunet/wallet-enterprise-vid-issuer:latest docker-push: true - dockerfile-path: ./wallet-enterprise-configurations/vid-issuer/Dockerfile \ No newline at end of file + dockerfile-path: ./wallet-enterprise-configurations/vid-issuer/Dockerfile diff --git a/wallet-enterprise-configurations/acme-verifier/wallet-enterprise-acme-verifier.Dockerfile b/wallet-enterprise-configurations/acme-verifier/Dockerfile similarity index 83% rename from wallet-enterprise-configurations/acme-verifier/wallet-enterprise-acme-verifier.Dockerfile rename to wallet-enterprise-configurations/acme-verifier/Dockerfile index c65fa1d..5c27911 100755 --- a/wallet-enterprise-configurations/acme-verifier/wallet-enterprise-acme-verifier.Dockerfile +++ b/wallet-enterprise-configurations/acme-verifier/Dockerfile @@ -14,20 +14,22 @@ COPY ./wallet-enterprise-configurations/acme-verifier/views/verifier/success.pug COPY ./wallet-enterprise-configurations/acme-verifier/public/styles/styles.css /app/public/styles/styles.css COPY ./wallet-enterprise-configurations/acme-verifier/public/images /app/public/images -RUN yarn cache clean && yarn install && yarn build +RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \ + yarn cache clean && yarn install && yarn build # Production stage FROM node:16-bullseye-slim AS production WORKDIR /app COPY --from=builder /app/package.json . -COPY --from=builder /app/.npmrc . COPY --from=builder /app/dist ./dist COPY --from=builder /app/public ./public COPY --from=builder /app/views/ ./views/ -RUN yarn install --production +RUN --mount=type=secret,id=npmrc,required=true,target=./.npmrc,uid=1000 \ + yarn cache clean && yarn install --production + ENV NODE_ENV production EXPOSE 8003 diff --git a/wallet-enterprise-configurations/ehic-issuer/wallet-enterprise-ehic-issuer.Dockerfile b/wallet-enterprise-configurations/ehic-issuer/Dockerfile similarity index 97% rename from wallet-enterprise-configurations/ehic-issuer/wallet-enterprise-ehic-issuer.Dockerfile rename to wallet-enterprise-configurations/ehic-issuer/Dockerfile index f16a9e1..fbecbc4 100755 --- a/wallet-enterprise-configurations/ehic-issuer/wallet-enterprise-ehic-issuer.Dockerfile +++ b/wallet-enterprise-configurations/ehic-issuer/Dockerfile @@ -18,7 +18,6 @@ FROM node:16-bullseye-slim AS production WORKDIR /app COPY --from=builder /app/package.json . -COPY --from=builder /app/.npmrc . COPY --from=builder /app/dist/ ./dist/ COPY --from=builder /app/public/ ./public/ COPY --from=builder /app/views/ ./views/ diff --git a/wallet-enterprise-configurations/pda1-issuer/wallet-enterprise-pda1-issuer.Dockerfile b/wallet-enterprise-configurations/pda1-issuer/Dockerfile old mode 100755 new mode 100644 similarity index 97% rename from wallet-enterprise-configurations/pda1-issuer/wallet-enterprise-pda1-issuer.Dockerfile rename to wallet-enterprise-configurations/pda1-issuer/Dockerfile index 3f25ac2..d8d79cd --- a/wallet-enterprise-configurations/pda1-issuer/wallet-enterprise-pda1-issuer.Dockerfile +++ b/wallet-enterprise-configurations/pda1-issuer/Dockerfile @@ -18,7 +18,6 @@ FROM node:16-bullseye-slim AS production WORKDIR /app COPY --from=builder /app/package.json . -COPY --from=builder /app/.npmrc . COPY --from=builder /app/dist/ ./dist/ COPY --from=builder /app/public/ ./public/ COPY --from=builder /app/views/ ./views/ diff --git a/wallet-enterprise-configurations/vid-issuer/Dockerfile b/wallet-enterprise-configurations/vid-issuer/Dockerfile index 09a699f..4b65273 100755 --- a/wallet-enterprise-configurations/vid-issuer/Dockerfile +++ b/wallet-enterprise-configurations/vid-issuer/Dockerfile @@ -2,8 +2,6 @@ FROM node:16-bullseye-slim AS builder WORKDIR /app - - COPY wallet-enterprise/ . RUN rm -rf src/configuration/ COPY ./wallet-enterprise-configurations/vid-issuer/src/configuration/ src/configuration/ @@ -20,7 +18,6 @@ FROM node:16-bullseye-slim AS production WORKDIR /app COPY --from=builder /app/package.json . -COPY --from=builder /app/.npmrc . COPY --from=builder /app/dist/ ./dist/ COPY --from=builder /app/public/ ./public/ COPY --from=builder /app/views/ ./views/