Implement Docker support with Dockerfile, docker-compose, and nginx configuration; add HTTPS redirection option and update appsettings
This commit is contained in:
parent
17a561094a
commit
7a919491d2
7 changed files with 215 additions and 2 deletions
26
Dockerfile
Normal file
26
Dockerfile
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
||||
WORKDIR /src
|
||||
|
||||
COPY ["WorkTracker.csproj", "./"]
|
||||
RUN dotnet restore "WorkTracker.csproj"
|
||||
|
||||
COPY . .
|
||||
RUN dotnet publish "WorkTracker.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends wget \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV ASPNETCORE_URLS=http://+:8080
|
||||
|
||||
COPY --from=build /app/publish .
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD wget -qO- http://127.0.0.1:8080/ >/dev/null 2>&1 || exit 1
|
||||
|
||||
ENTRYPOINT ["dotnet", "WorkTracker.dll"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue