dockerfile 535 B

123456789101112131415161718192021
  1. FROM mcr.microsoft.com/dotnet/sdk:6.0-bullseye-slim AS build-env
  2. WORKDIR /app
  3. # Copy necessary files and restore as distinct layer
  4. COPY TrafficControlService.csproj ./
  5. RUN dotnet restore
  6. # Copy everything else and build
  7. COPY . ./
  8. RUN dotnet publish -c Release -o out TrafficControlService.csproj
  9. # Build runtime image
  10. FROM mcr.microsoft.com/dotnet/aspnet:6.0-bullseye-slim
  11. COPY --from=build-env /app/out .
  12. # Expose ports
  13. EXPOSE 6000/tcp
  14. ENV ASPNETCORE_URLS http://*:6000
  15. # Start
  16. ENTRYPOINT ["dotnet", "TrafficControlService.dll"]