Linux AOT and Container
This commit is contained in:
25
Dockerfile
Normal file
25
Dockerfile
Normal file
@ -0,0 +1,25 @@
|
||||
# Stage 1: Build Stage
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
# restore
|
||||
COPY ["src/File-Folder-Helper/File-Folder-Helper.csproj", "File-Folder-Helper/"]
|
||||
RUN dotnet restore 'File-Folder-Helper/File-Folder-Helper.csproj'
|
||||
|
||||
# build
|
||||
COPY ["src/File-Folder-Helper", "File-Folder-Helper/"]
|
||||
WORKDIR /src/File-Folder-Helper
|
||||
RUN dotnet build 'File-Folder-Helper.csproj' -c Release -o /app/build
|
||||
|
||||
# Stage 2: Publish Stage
|
||||
FROM build AS publish
|
||||
RUN dotnet publish 'File-Folder-Helper.csproj' -c Release -o /app/publish
|
||||
|
||||
# Stage 3: Run Stage
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||
ENV ASPNETCORE_HTTP_PORTS=5001
|
||||
EXPOSE 5001
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT [ "dotnet", "File-Folder-Helper.dll" ]
|
Reference in New Issue
Block a user