-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (24 loc) · 1.14 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
ARG BuildVersion
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
WORKDIR /app
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
# For more info, please refer to https://aka.ms/vscode-docker-dotnet-configure-containers
RUN adduser -u 5678 --disabled-password --gecos "" tubescanuser && chown -R tubescanuser /app
USER tubescanuser
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
ARG BuildVersion
WORKDIR /src
COPY ["src/TubeScan/TubeScan.csproj", "src/TubeScan/"]
RUN dotnet restore "src/TubeScan/TubeScan.csproj"
COPY . .
WORKDIR "/src/src/TubeScan"
RUN dotnet tool restore
RUN dotnet paket restore
RUN dotnet build "TubeScan.csproj" -c Release -o /app/build /p:AssemblyInformationalVersion=${BuildVersion} /p:AssemblyFileVersion=${BuildVersion}
FROM build AS publish
ARG BuildVersion
RUN dotnet publish "TubeScan.csproj" -c Release -o /app/publish /p:AssemblyInformationalVersion=${BuildVersion} /p:AssemblyFileVersion=${BuildVersion} /p:Version=${BuildVersion} --os linux --arch x64 --self-contained
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "TubeScan.dll", "start"]