File tree Expand file tree Collapse file tree 3 files changed +50
-0
lines changed
.github/actions/build-libraries Expand file tree Collapse file tree 3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 5151 path : " src/server/host/bin/Release"
5252 name : libs-host-${{ inputs.version }}
5353 include-hidden-files : true
54+
55+ - name : Set up Docker Buildx
56+ uses : docker/setup-buildx-action@v3
57+
58+ - name : Build and export
59+ uses : docker/build-push-action@v6
60+ with :
61+ context : ./src/server
62+ file : Dockerfile
63+ tags : |
64+ ghcr.io/nhsdigital/libshostdocker:latest
65+ ghcr.io/nhsdigital/libshostdocker:${{ inputs.version }}
66+ outputs : type=docker,dest=${{ runner.temp }}/myimage.tar
67+
68+ - name : Upload artifact
69+ uses : actions/upload-artifact@v4
70+ with :
71+ name : libs-host-docker-${{ inputs.version }}
72+ path : ${{ runner.temp }}/myimage.tar
Original file line number Diff line number Diff line change 1+ # Multi-stage Dockerfile for .NET 8 Web API
2+ # Build stage
3+ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
4+ WORKDIR /src
5+
6+ # Copy solution and restore as distinct layers
7+ COPY .version ./
8+ COPY build.sh ./
9+ COPY server.sln ./
10+ COPY host/host.csproj ./host/
11+ COPY abstractions/abstractions.csproj ./abstractions/
12+ COPY data/data.csproj ./data/
13+ COPY letter/letter.csproj ./letter/
14+ COPY . .
15+
16+ RUN ./build.sh
17+
18+ # Runtime stage
19+ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
20+ WORKDIR /app
21+ COPY --from=build src/host/bin/Release/net8.0/publish .
22+
23+ # Expose port (change if your app uses a different port)
24+ EXPOSE 8080
25+
26+ # Set environment variables (optional)
27+ # ENV ASPNETCORE_URLS=http://+:80
28+ RUN ls -la
29+
30+ ENTRYPOINT ["./run.sh" ]
Original file line number Diff line number Diff line change @@ -4,4 +4,5 @@ SuppliersApi__Letters=true \
44SuppliersApi__Data=true \
55SuppliersApi__Assemblies__0=" nhs.notify.suppliers.api.letter" \
66SuppliersApi__Assemblies__1=" nhs.notify.suppliers.api.data" \
7+ ASPNETCORE_ENVIRONMENT=" Development" \
78dotnet nhs.notify.suppliers.api.host.dll
You can’t perform that action at this time.
0 commit comments