Skip to content

Commit

Permalink
Update dockerfile to include rust build (#122)
Browse files Browse the repository at this point in the history
* Added interop

* Fix FFI when given schema version

* Remove test function

* Added frontend part

* update CI

* Delete Makefile

* Revert "Delete Makefile"

This reverts commit 6bb3207.

* Update ci.yml

* set version

* Fix paths

* Added documentation headers to functions

* Bump versions and update changelog

* Use tabList instead of accordion

* Update Makefile

Co-authored-by: Michael Bisgaard Olesen <[email protected]>

* Update backend/Application/Aggregates/Contract/Entities/ModuleReferenceEvent.cs

Co-authored-by: Søren Hjort <[email protected]>

* Update .github/workflows/ci.yml

Co-authored-by: Søren Hjort <[email protected]>

* Updated CI by included needed components

* Move unstable features to readme

* fix clippy

* format

* Refactored tests

* Remove unnecessary step and refactor ordering

* Move mapping of FFIOption

* Update function name

* Update InteropBinding.cs

* Updated variable name

* Refactor rust-bindings to reduce glue code (#121)

* Refactor rust-bindings to reduce glue code

* Address feedback

* Pass closure again

* Make assign_result unsafe + add doc

* move private below public

* added back build since it is needed to create binaries for .net

* Change to throw exceptions

* Changed name

* Refactoring

* Update README.md

Co-authored-by: Søren Hjort <[email protected]>

* Update jenkins file to checkout submodules and build rust binaries

* removed workspace

* docker file update

* Added dependency

* remove dep

* remove steps from jenkins pipeline

* Add parameter to control rust build as part of dotnet build

* remove restore since part of publish

---------

Co-authored-by: Michael Bisgaard Olesen <[email protected]>
Co-authored-by: Søren Hjort <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent d461f0d commit 50de657
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
5 changes: 3 additions & 2 deletions backend/Application/Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<Version>1.7.7</Version>
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
<RunRustBuild>true</RunRustBuild>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -58,7 +59,7 @@
</None>
</ItemGroup>

<Target Name="BuildRustProject" BeforeTargets="Build">
<Target Name="BuildRustProject" BeforeTargets="Build" Condition="$(RunRustBuild)">
<Exec Command="cargo build --manifest-path=../rust-bindings/Cargo.toml --release" />
</Target>

Expand Down
18 changes: 10 additions & 8 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 5000

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
FROM rust:1.65 AS rust-builder
WORKDIR /src
COPY ["Application/Application.csproj", "Application/"]
RUN dotnet restore "Application/Application.csproj"
COPY . .
WORKDIR "/src/Application"
RUN dotnet build "Application.csproj" -c Release -o /app/build
COPY rust-bindings/ rust-bindings/
RUN cargo build --manifest-path=./rust-bindings/Cargo.toml --release

FROM build AS publish
RUN dotnet publish "Application.csproj" -c Release -o /app/publish
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS publish
WORKDIR /src
COPY --from=rust-builder /src/rust-bindings/target rust-bindings/target
COPY Application/ Application/
COPY DatabaseScripts/ DatabaseScripts/
WORKDIR "/src/Application"
RUN dotnet publish "Application.csproj" -c Release -o /app/publish -p:RunRustBuild=false

FROM base AS final
# Install 'ca-certificates' for supporting HTTPS.
Expand Down

0 comments on commit 50de657

Please sign in to comment.