build(api): add Dockerfile for API service
This commit is contained in:
23
src/IncidentOps.Api/Dockerfile
Normal file
23
src/IncidentOps.Api/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||||
|
WORKDIR /src
|
||||||
|
|
||||||
|
# Copy csproj files and restore
|
||||||
|
COPY src/IncidentOps.Contracts/IncidentOps.Contracts.csproj src/IncidentOps.Contracts/
|
||||||
|
COPY src/IncidentOps.Domain/IncidentOps.Domain.csproj src/IncidentOps.Domain/
|
||||||
|
COPY src/IncidentOps.Infrastructure/IncidentOps.Infrastructure.csproj src/IncidentOps.Infrastructure/
|
||||||
|
COPY src/IncidentOps.Api/IncidentOps.Api.csproj src/IncidentOps.Api/
|
||||||
|
RUN dotnet restore src/IncidentOps.Api/IncidentOps.Api.csproj
|
||||||
|
|
||||||
|
# Copy source and build
|
||||||
|
COPY src/ src/
|
||||||
|
WORKDIR /src/src/IncidentOps.Api
|
||||||
|
RUN dotnet publish -c Release -o /app --no-restore
|
||||||
|
|
||||||
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=build /app .
|
||||||
|
|
||||||
|
ENV ASPNETCORE_URLS=http://+:8080
|
||||||
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENTRYPOINT ["dotnet", "IncidentOps.Api.dll"]
|
||||||
Reference in New Issue
Block a user