forked from mtusi2026/mtusi2026lab2
Добавить PostgreSQL и сессии для лабораторной 2.
Пароли хранятся как Argon2id, сессии переживают перезапуск базы.
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0.401 AS build
|
||||
WORKDIR /src
|
||||
COPY src/Messenger/Messenger.csproj ./Messenger/
|
||||
RUN dotnet restore ./Messenger/Messenger.csproj
|
||||
COPY src/Messenger/ ./Messenger/
|
||||
RUN dotnet publish ./Messenger/Messenger.csproj -c Release -o /out --no-restore /p:UseAppHost=false
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:10.0.12
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
WORKDIR /app
|
||||
COPY --from=build /out .
|
||||
USER $APP_UID
|
||||
ENV APP_HOST=0.0.0.0 \
|
||||
APP_PORT=8080 \
|
||||
APP_ENV=lab \
|
||||
ASPNETCORE_ENVIRONMENT=Production \
|
||||
DOTNET_EnableDiagnostics=0
|
||||
EXPOSE 8080
|
||||
HEALTHCHECK --interval=5s --timeout=3s --start-period=15s --retries=10 \
|
||||
CMD curl --fail --silent http://127.0.0.1:8080/health/ready || exit 1
|
||||
ENTRYPOINT ["dotnet", "Messenger.dll"]
|
||||
Reference in New Issue
Block a user