Skip to content

Commit

Permalink
Update docker things
Browse files Browse the repository at this point in the history
  • Loading branch information
sfmskywalker committed Dec 30, 2022
1 parent e653663 commit 01c70e5
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/all-in-one-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
with:
platforms: all

Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./src/bundles/Elsa.AllInOne.Web/Dockerfile
file: ./docker/Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
6 changes: 6 additions & 0 deletions Elsa.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ProjectSection(SolutionItems) = preProject
icon.png = icon.png
.github\workflows\packages.yml = .github\workflows\packages.yml
.github\workflows\all-in-one-web.yml = .github\workflows\all-in-one-web.yml
build-and-run-all-in-one-web-docker.sh = build-and-run-all-in-one-web-docker.sh
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{0354F050-3992-4DD4-B0EE-5FBA04AC72B6}"
Expand Down Expand Up @@ -132,6 +133,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Samples.WorkflowDesign
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elsa.Samples.WorkflowServerAndDesigner", "src\samples\aspnet\Elsa.Samples.WorkflowServerAndDesigner\Elsa.Samples.WorkflowServerAndDesigner.csproj", "{34FBB2D3-4E2B-4411-95F2-C6B56899826A}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{986E5482-0482-448C-B9E4-EC67A9474B85}"
ProjectSection(SolutionItems) = preProject
docker\Dockerfile = docker\Dockerfile
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
2 changes: 2 additions & 0 deletions build-and-run-all-in-one-web-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
docker build -t elsa-3:local -f ./docker/Dockerfile .
docker run -t -i -e ASPNETCORE_ENVIRONMENT='Development' -p 13000:80 elsa-3:local
File renamed without changes.
33 changes: 33 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM mcr.microsoft.com/dotnet/sdk:7.0-bullseye-slim AS build
WORKDIR /source

# install node
ENV NODE_VERSION=18.12.1
RUN apt install -y curl
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN node --version
RUN npm --version

# restore packages
COPY src/. ./src
COPY *.props ./
RUN dotnet restore "./src/bundles/Elsa.AllInOne.Web/Elsa.AllInOne.Web.csproj"

# build and publish (UseAppHost=false creates platform independent binaries)
WORKDIR /source/src/bundles/Elsa.AllInOne.Web
RUN dotnet build "Elsa.AllInOne.Web.csproj" -c Release -o /app/build
RUN dotnet publish "Elsa.AllInOne.Web.csproj" -c Release -o /app/publish /p:UseAppHost=false --no-restore -f net7.0

# move binaries into smaller base image
FROM mcr.microsoft.com/dotnet/aspnet:7.0-bullseye-slim AS base
WORKDIR /app
COPY --from=build /app/publish ./

EXPOSE 80/tcp
EXPOSE 443/tcp
ENTRYPOINT ["dotnet", "Elsa.AllInOne.Web.dll"]
21 changes: 0 additions & 21 deletions src/bundles/Elsa.AllInOne.Web/Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion src/bundles/Elsa.AllInOne.Web/Elsa.AllInOne.Web.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/Elsa.JavaScript/Elsa.JavaScript.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Jint" Version="3.0.0-preview-388" />
<PackageReference Include="Jint" Version="3.0.0-beta-2044" />
</ItemGroup>

</Project>

0 comments on commit 01c70e5

Please sign in to comment.