Skip to content

Commit

Permalink
Update build for new preservation-api image
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldgray committed Apr 30, 2024
1 parent c9647f3 commit 4814dc8
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/actions/docker-build-and-push/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ runs:
using: "composite"
steps:
- id: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- id: docker-setup-buildx
uses: docker/setup-buildx-action@v2
- id: docker-meta
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,30 @@ on:

jobs:

build-push-api:
build-push-storage-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/docker-build-and-push
name: build and push
with:
image-name: "Preservation-API"
image-name: "Storage-API"
dockerfile: "./LeedsExperiment/Storage.API/Dockerfile"
context: "./LeedsExperiment/"
github-token: ${{ secrets.GITHUB_TOKEN }}

build-push-preservation-api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/docker-build-and-push
name: build and push
with:
image-name: "Preservation-API"
dockerfile: "./LeedsExperiment/Preservation.API/Dockerfile"
context: "./LeedsExperiment/"
github-token: ${{ secrets.GITHUB_TOKEN }}

build-push-dashboard:
runs-on: ubuntu-latest
steps:
Expand Down
25 changes: 25 additions & 0 deletions LeedsExperiment/Preservation.API/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER app
WORKDIR /app
EXPOSE 8080
EXPOSE 8081

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["Preservation.API/Preservation.API.csproj", "Preservation.API/"]
RUN dotnet restore "./Preservation.API/./Preservation.API.csproj"
COPY . .
WORKDIR "/src/Preservation.API"
RUN dotnet build "./Preservation.API.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./Preservation.API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Preservation.API.dll"]
11 changes: 10 additions & 1 deletion LeedsExperiment/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,13 @@ Experiments related to DLIP project.
* `PreservationApiClient` - API client for Storage.API (*lkely renamed in future*)
* SamplesWorker
* `Storage.API` - _was_ `Preservation.API` but renamed. Wrapper around Fedora API
* `Preservation.API` - higher level API. Sits infront of `Storage.API` and used by client applications for API interactions
* `Preservation.API` - higher level API. Sits infront of `Storage.API` and used by client applications for API interactions

## Building Image

```bash
cd .\LeedsExperiment\
docker build -t dlip-storage:local -f .\Storage.API\Dockerfile .
docker build -t dlip-preservation:local -f .\Preservation.API\Dockerfile .
docker build -t dlip-dash:local -f .\Dashboard\Dockerfile .
```

0 comments on commit 4814dc8

Please sign in to comment.