Обновление docker под Playwright
All checks were successful
Create and publish a Docker image / Publish image (push) Successful in 4m53s

This commit is contained in:
2025-09-06 19:28:43 +03:00
parent 60d541e34f
commit ae7c55cce3
3 changed files with 23 additions and 14 deletions

View File

@@ -1,22 +1,24 @@
FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine3.22 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine3.22 AS build
ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["SfeduSchedule.csproj", "SfeduSchedule.csproj"]
RUN dotnet restore "SfeduSchedule.csproj"
COPY . .
WORKDIR "/src"
RUN dotnet build "SfeduSchedule.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet restore "SfeduSchedule.csproj"
RUN dotnet publish "SfeduSchedule.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
FROM base AS final
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
EXPOSE 8080
WORKDIR /app
COPY --from=publish /app/publish .
RUN apt-get update && \
apt-get install -y --no-install-recommends wget && \
wget -q https://github.com/PowerShell/PowerShell/releases/download/v7.5.2/powershell_7.5.2-1.deb_amd64.deb && \
apt-get install -y ./powershell_7.5.2-1.deb_amd64.deb && \
rm -f powershell_7.5.2-1.deb_amd64.deb && \
rm -rf /var/lib/apt/lists/*
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
COPY --from=build /app/publish .
RUN pwsh ./playwright.ps1 install --with-deps chromium
ENTRYPOINT ["dotnet", "SfeduSchedule.dll"]

View File

@@ -13,5 +13,10 @@ services:
- MS_USERNAME=${MS_USERNAME}
- MS_PASSWORD=${MS_PASSWORD}
# - TOKEN=
volumes:
- data:/app/data
restart: always
image: git.zetcraft.ru/serega404/sfeduschedule:main
volumes:
data:

View File

@@ -13,6 +13,8 @@ services:
- MS_USERNAME=
- MS_PASSWORD=
# - TOKEN=
volumes:
- ./data:/app/data
restart: unless-stopped
build:
context: ./SfeduSchedule