From 5e07f01af25b7480e40951bec202eeab38d3eb45 Mon Sep 17 00:00:00 2001 From: Anders Sparrevohn Date: Tue, 9 Aug 2022 12:39:13 +0200 Subject: [PATCH] Change docker image workflow to use official actions --- .github/workflows/docker-image.yml | 15 +++++++++------ Dockerfile | 6 +++--- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index b1332b28b..f117b1045 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -10,21 +10,24 @@ jobs: build_and_push: runs-on: ubuntu-latest steps: - - name: checkout code + - name: Checkout code uses: actions/checkout@v3 - - name: install buildx + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Set up Docker Buildx id: buildx - uses: crazy-max/ghaction-docker-buildx@v1 + uses: docker/setup-buildx-action@v2 - - name: login to docker hub + - name: Login to docker hub uses: docker/login-action@v2 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - - name: build the image + - name: Build the image run: | docker buildx build --push \ --tag grobut939/ghostfolio:latest \ - --platform linux/amd64,linux/arm/v7,linux/arm64 . + --platform linux/amd64,linux/arm64 . diff --git a/Dockerfile b/Dockerfile index 79ed1ab5f..148c1d7b3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ FROM node:16-slim as builder # Build application and add additional files - WORKDIR /ghostfolio # Only add basic files without the application itself to avoid rebuilding @@ -13,11 +12,11 @@ COPY ./yarn.lock yarn.lock COPY ./prisma/schema.prisma prisma/schema.prisma RUN apt update && apt install -y \ - python3 \ + git \ g++ \ make \ openssl \ - git \ + python3 \ && rm -rf /var/lib/apt/lists/* RUN yarn install @@ -55,6 +54,7 @@ FROM node:16-slim RUN apt update && apt install -y \ openssl \ && rm -rf /var/lib/apt/lists/* + COPY --from=builder /ghostfolio/dist/apps /ghostfolio/apps WORKDIR /ghostfolio/apps/api EXPOSE 3333