Browse Source

Change docker image workflow to use official actions

pull/1134/head
Anders Sparrevohn 3 years ago
parent
commit
5e07f01af2
  1. 15
      .github/workflows/docker-image.yml
  2. 6
      Dockerfile

15
.github/workflows/docker-image.yml

@ -10,21 +10,24 @@ jobs:
build_and_push: build_and_push:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: install buildx - name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: 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 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKER_USERNAME }} username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: build the image - name: Build the image
run: | run: |
docker buildx build --push \ docker buildx build --push \
--tag grobut939/ghostfolio:latest \ --tag grobut939/ghostfolio:latest \
--platform linux/amd64,linux/arm/v7,linux/arm64 . --platform linux/amd64,linux/arm64 .

6
Dockerfile

@ -1,7 +1,6 @@
FROM node:16-slim as builder FROM node:16-slim as builder
# Build application and add additional files # Build application and add additional files
WORKDIR /ghostfolio WORKDIR /ghostfolio
# Only add basic files without the application itself to avoid rebuilding # 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 COPY ./prisma/schema.prisma prisma/schema.prisma
RUN apt update && apt install -y \ RUN apt update && apt install -y \
python3 \ git \
g++ \ g++ \
make \ make \
openssl \ openssl \
git \ python3 \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN yarn install RUN yarn install
@ -55,6 +54,7 @@ FROM node:16-slim
RUN apt update && apt install -y \ RUN apt update && apt install -y \
openssl \ openssl \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY --from=builder /ghostfolio/dist/apps /ghostfolio/apps COPY --from=builder /ghostfolio/dist/apps /ghostfolio/apps
WORKDIR /ghostfolio/apps/api WORKDIR /ghostfolio/apps/api
EXPOSE 3333 EXPOSE 3333

Loading…
Cancel
Save