-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
21 lines (14 loc) · 720 Bytes
/
Dockerfile
File metadata and controls
21 lines (14 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM mcr.microsoft.com/dotnet/sdk:8.0.203 AS build-env
WORKDIR /src
# copy csproj and restore as distinct layers
COPY ./src/ValMati.StockBot/ValMati.StockBot.csproj Directory.Build.props ./src/ValMati.StockBot/
RUN dotnet restore ./src/ValMati.StockBot/ValMati.StockBot.csproj --runtime linux-x64 /property:Configuration=Release
# copy everything else and build
COPY . .
RUN dotnet publish ./src/ValMati.StockBot/ValMati.StockBot.csproj -c Release -o /publish --no-restore --runtime linux-x64 --no-self-contained /p:DebugType=None /p:Platform=x64
# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0.3
WORKDIR /app
COPY --from=build-env /publish .
USER app
ENTRYPOINT ["dotnet", "ValMati.StockBot.dll"]