WorkTracker/Dockerfile
MaddoScientisto 7029e374cc
Some checks failed
Publish Container / publish (push) Has been cancelled
Refactor authentication system to use MongoDB
- Removed Entity Framework Core identity schema and related migrations.
- Introduced MongoDB-based authentication service with user seeding functionality.
- Updated Program.cs to configure authentication and authorization using cookies.
- Created new Login.razor component for user login interface.
- Added RedirectToLogin component for handling unauthorized access.
- Updated Dockerfile and docker-compose files for development and production environments.
- Removed SQLite connection strings and related configurations.
- Added MongoDB connection settings in appsettings.json and Docker configurations.
- Implemented IMongoAuthService interface and MongoAuthService class for user management.
- Created MongoAuthUser model for MongoDB user representation.
2026-03-16 21:54:44 +01:00

38 lines
1,013 B
Docker

FROM mcr.microsoft.com/dotnet/sdk:10.0-noble AS dev
WORKDIR /workspace
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl procps unzip wget \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL https://aka.ms/getvsdbgsh | bash /dev/stdin -v latest -l /vsdbg
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:10.0-noble 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:10.0-noble 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"]