Update docker files

This commit is contained in:
Sipke Schoorstra 2021-05-15 11:59:57 +02:00
parent f02ec47109
commit 7ae29a4c24
6 changed files with 22 additions and 165 deletions

View file

@ -1,74 +0,0 @@
name: Build elsa-dashboard:[tag] and :stable
on:
push:
tags:
- 'v*.*.*'
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install NPM dependencies
uses: bahmutov/npm-install@v1
with:
useRollingCache: true
working-directory: |
src/designer/elsa-workflows-studio
src/designer/bindings/blazor/Elsa.Designer.Bindings.Blazor
- name: Build NPM packages for elsa-workflows-studio
run: npm run build
working-directory: src/designer/elsa-workflows-studio
- name: Build NPM packages for Elsa.Designer.Bindings.Blazor
run: npm run build
working-directory: src/designer/bindings/blazor/Elsa.Designer.Bindings.Blazor
- name: Generate Docker tag
id: docker-tag
uses: yuya-takeyama/docker-tag-from-github-ref-action@v1
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ghcr.io/elsa-workflows/elsa-core/elsa-dashboard:${{ steps.docker-tag.outputs.tag }}, ghcr.io/elsa-workflows/elsa-core/elsa-dashboard:stable
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View file

@ -2,8 +2,8 @@ name: Build elsa-dashboard:latest
on:
workflow_dispatch:
push:
branches:
- master
branches:
- master
#release:
# types: [published]
@ -12,19 +12,19 @@ jobs:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
@ -32,13 +32,13 @@ jobs:
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
@ -48,9 +48,9 @@ jobs:
file: ./docker/Dockerfile-elsa-dashboard
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: elsa-dashboard:latest,elsa-workflows/elsa-dashboard:latest,${{ secrets.DOCKER_USER }}/elsa-dashboard:latest
tags: elsa-dashboard:latest,elsaworkflows/elsa-dashboard:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View file

@ -1,73 +0,0 @@
name: Build elsa-dashboard-with-server:latest
on:
workflow_dispatch:
push:
branches:
- master
#release:
# types: [published]
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install NPM dependencies
uses: bahmutov/npm-install@v1
with:
useRollingCache: true
working-directory: |
src/designer/elsa-workflows-studio
src/designer/bindings/aspnet/Elsa.Designer.Components.Web
- name: Build NPM packages for elsa-workflows-studio
run: npm run build
working-directory: src/designer/elsa-workflows-studio
- name: Build NPM packages for Elsa.Designer.Components.Web
run: npm run build
working-directory: src/designer/bindings/aspnet/Elsa.Designer.Components.Web
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ghcr.io/elsa-workflows/elsa-core/elsa-dashboard:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}

View file

@ -265,9 +265,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{D7F754
ProjectSection(SolutionItems) = preProject
docker\docker-compose.yaml = docker\docker-compose.yaml
docker\Dockerfile = docker\Dockerfile
docker\Dockerfile-with-npm = docker\Dockerfile-with-npm
docker\README.md = docker\README.md
docker\Dockerfile-elsa-dashboard = docker\Dockerfile-elsa-dashboard
docker\Dockerfile-elsa-dashboard-and-server = docker\Dockerfile-elsa-dashboard-and-server
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Persistence.EntityFramework.MySql", "src\persistence\Elsa.Persistence.EntityFramework\Elsa.Persistence.EntityFramework.MySql\Elsa.Persistence.EntityFramework.MySql.csproj", "{D55BC08B-CA82-478A-99F7-EDE90AC33160}"
@ -280,6 +280,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "aspnetcore", "aspnetcore",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ElsaDashboard.Web", "src\dashboards\aspnetcore\ElsaDashboard\ElsaDashboard.Web.csproj", "{5F81C84A-4C04-48FF-981C-23E48A7ACA6C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "github", "github", "{3BF2C5A9-AC69-4587-833F-C16CFC97E100}"
ProjectSection(SolutionItems) = preProject
.github\workflows\publish-latest-dashboard-docker.yml = .github\workflows\publish-latest-dashboard-docker.yml
.github\workflows\publish-latest-server-docker.yml = .github\workflows\publish-latest-server-docker.yml
.github\workflows\publish-latest-dashboard-and-server-docker.yml = .github\workflows\publish-latest-dashboard-and-server-docker.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

View file

@ -1,2 +1,2 @@
docker build -t elsa-dashboard:latest -t elsa-workflows/elsa-dashboard:latest -t ndakota81/elsa-dashboard -f ./docker/Dockerfile-elsa-dashboard .
docker push ndakota81/elsa-dashboard:latest
docker build -t elsa-dashboard:latest -t elsaworkflows/elsa-dashboard:latest -f ./docker/Dockerfile-elsa-dashboard .
docker push elsaworkflows/elsa-dashboard:latest

View file

@ -11,7 +11,6 @@ WORKDIR /app/designer/bindings/aspnet/Elsa.Designer.Components.Web
RUN npm install --force
RUN npm run build
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim-amd64 AS build
WORKDIR /source
@ -26,13 +25,11 @@ COPY ./Nuget.Config ./
COPY --from=client-build /app/designer/elsa-workflows-studio ./src/designer/elsa-workflows-studio
COPY --from=client-build /app/designer/bindings/aspnet/Elsa.Designer.Components.Web ./src/designer/bindings/aspnet/Elsa.Designer.Components.Web
# build and publish (UseAppHost=false created platform independent binaries)
# build and publish (UseAppHost=false creates platform independent binaries)
WORKDIR /source/src/samples/dashboard/aspnetcore/ElsaDashboard.Samples.AspNetCore.Monolith
RUN dotnet build "ElsaDashboard.Samples.AspNetCore.Monolith.csproj" -c Release -o /app/build
RUN dotnet publish "ElsaDashboard.Samples.AspNetCore.Monolith.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore
# move binaries into smaller base image
FROM mcr.microsoft.com/dotnet/aspnet:5.0-buster-slim AS base
WORKDIR /app