Skip to content

Commit 13de000

Browse files
author
xyzjesper
committed
Build Default MS Docker Image
1 parent 641f415 commit 13de000

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

DisBot-Helper-Bot/Dockerfile

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base
22
USER $APP_UID
33
WORKDIR /app
4+
45
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
56
ARG BUILD_CONFIGURATION=Release
67
WORKDIR /src
78
COPY ["DisBot-Helper-Bot/DisBot-Helper-Bot.csproj", "DisBot-Helper-Bot/"]
89
RUN dotnet restore "DisBot-Helper-Bot/DisBot-Helper-Bot.csproj"
910
COPY . .
1011
WORKDIR "/src/DisBot-Helper-Bot"
11-
RUN dotnet publish "./DisBot-Helper-Bot.csproj" -c Release -r linux-x64 \
12-
--self-contained true \
13-
-p:PublishReadyToRun=true \
14-
-p:PublishSingleFile=true \
15-
-o /app/publish
12+
RUN dotnet build "./DisBot-Helper-Bot.csproj" -c $BUILD_CONFIGURATION -o /app/build
13+
1614
FROM build AS publish
1715
ARG BUILD_CONFIGURATION=Release
18-
RUN dotnet publish "./DisBot-Helper-Bot.csproj" -c Release -r linux-x64 \
19-
--self-contained true \
20-
-p:PublishReadyToRun=true \
21-
-p:PublishSingleFile=true \
22-
-o /app/publish
16+
RUN dotnet publish "./DisBot-Helper-Bot.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
17+
2318
FROM base AS final
2419
WORKDIR /app
2520
COPY --from=publish /app/publish .
26-
RUN chmod +x ./DisBot-Helper-Bot
27-
CMD ["./DisBot-Helper-Bot"]
21+
ENTRYPOINT ["dotnet", "DisBot-Helper-Bot.dll"]

0 commit comments

Comments
 (0)