Files
jsmr/JSMR.Api/Dockerfile
Brian Bicknell d9a62a6fbd
Some checks failed
ci / build-test (push) Has been skipped
ci / publish-image (push) Failing after 2m4s
Fixed dockerfile.
2025-11-02 22:42:17 -05:00

25 lines
836 B
Docker

# --- Build stage ---
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy solution + project files first (better layer caching)
COPY JSMR.sln ./
COPY JSMR/JSMR.Api/JSMR.Api.csproj JSMR/JSMR.Api/
COPY JSMR/JSMR.Application/JSMR.Application.csproj JSMR/JSMR.Application/
COPY JSMR/JSMR.Domain/JSMR.Domain.csproj JSMR/JSMR.Domain/
COPY JSMR/JSMR.Infrastructure/JSMR.Infrastructure.csproj JSMR/JSMR.Infrastructure/
RUN dotnet restore JSMR/JSMR.Api/JSMR.Api.csproj
# Copy the rest of the source and publish
COPY JSMR/ ./JSMR/
RUN dotnet publish JSMR/JSMR.Api/JSMR.Api.csproj -c Release -o /app/publish --no-restore
# --- Runtime stage ---
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
COPY --from=build /app/publish ./
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
ENTRYPOINT ["dotnet", "JSMR.Api.dll"]