Spaces:
No application file
No application file
Download DockerFile from Soham0708/dotnet-demo: direct link, hf CLI and curl.
- Browser
- Download file 546 Bytes
-
https://huggingface.co/spaces/Soham0708/dotnet-demo/resolve/main/DockerFile
- Command line
-
hf download hf://spaces/Soham0708/dotnet-demo/DockerFile
-
curl -L -o DockerFile https://huggingface.co/spaces/Soham0708/dotnet-demo/resolve/main/DockerFile
546 Bytes
| # Use official .NET SDK image to build the project | |
| FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | |
| WORKDIR /app | |
| # Copy project files and restore dependencies | |
| COPY . ./ | |
| RUN dotnet restore | |
| # Build the application | |
| RUN dotnet publish -c Release -o /out --no-restore | |
| # Use a smaller runtime image for final container | |
| FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime | |
| WORKDIR /app | |
| # Copy built files from build stage | |
| COPY --from=build /out . | |
| # Expose the port | |
| EXPOSE 5000 | |
| EXPOSE 5001 | |
| # Start the application | |
| ENTRYPOINT ["dotnet", "UserApi.dll"] | |