Skip to content

Commit 8a82113

Browse files
committed
fixed docker gh action for disbot.
1 parent 5a45c6b commit 8a82113

4 files changed

Lines changed: 41 additions & 11 deletions

File tree

DisBot.API/Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ EXPOSE 8081
77
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
88
ARG BUILD_CONFIGURATION=Release
99
WORKDIR /src
10-
COPY ["API/API.csproj", "API/"]
10+
COPY ["DisBot.API/DisBot.API.csproj", "DisBot.API/"]
1111
RUN dotnet restore "API/API.csproj"
1212
COPY . .
13-
WORKDIR "/src/API"
14-
RUN dotnet build "./API.csproj" -c $BUILD_CONFIGURATION -o /app/build
13+
WORKDIR "/src/DisBot.API"
14+
RUN dotnet build "./DisBot.API.csproj" -c $BUILD_CONFIGURATION -o /app/build
1515

1616
FROM build AS publish
1717
ARG BUILD_CONFIGURATION=Release
18-
RUN dotnet publish "./API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
18+
RUN dotnet publish "./DisBot.API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
1919

2020
FROM base AS final
2121
WORKDIR /app
2222
COPY --from=publish /app/publish .
23-
ENTRYPOINT ["dotnet", "API.dll"]
23+
ENTRYPOINT ["dotnet", "DisBot.API.dll"]

DisBot.Dashboard/DisBot.Dashboard.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<OverrideHtmlAssetPlaceholders>true</OverrideHtmlAssetPlaceholders>
8+
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
89
</PropertyGroup>
910

1011
<ItemGroup>
@@ -17,4 +18,10 @@
1718
<_ContentIncludedByDefault Remove="wwwroot\css\app.css" />
1819
</ItemGroup>
1920

21+
<ItemGroup>
22+
<Content Include="..\.dockerignore">
23+
<Link>.dockerignore</Link>
24+
</Content>
25+
</ItemGroup>
26+
2027
</Project>

DisBot.Dashboard/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
2+
USER $APP_UID
3+
WORKDIR /app
4+
EXPOSE 8080
5+
EXPOSE 8081
6+
7+
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
8+
ARG BUILD_CONFIGURATION=Release
9+
WORKDIR /src
10+
COPY ["DisBot.Dashboard/DisBot.Dashboard.csproj", "DisBot.Dashboard/"]
11+
RUN dotnet restore "DisBot.Dashboard/DisBot.Dashboard.csproj"
12+
COPY . .
13+
WORKDIR "/src/DisBot.Dashboard"
14+
RUN dotnet build "./DisBot.Dashboard.csproj" -c $BUILD_CONFIGURATION -o /app/build
15+
16+
FROM build AS publish
17+
ARG BUILD_CONFIGURATION=Release
18+
RUN dotnet publish "./DisBot.Dashboard.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
19+
20+
FROM base AS final
21+
WORKDIR /app
22+
COPY --from=publish /app/publish .
23+
ENTRYPOINT ["dotnet", "DisBot.Dashboard.dll"]

DisBot.DiscordBot/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ WORKDIR /app
55
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
66
ARG BUILD_CONFIGURATION=Release
77
WORKDIR /src
8-
COPY ["DiscordBot/DiscordBot.csproj", "DiscordBot/"]
9-
RUN dotnet restore "DiscordBot/DiscordBot.csproj"
8+
COPY ["DisBot.DiscordBot/DisBot.DiscordBot.csproj", "DisBot.DiscordBot/"]
9+
RUN dotnet restore "DisBot.DiscordBot/DisBot.DiscordBot.csproj"
1010
COPY . .
11-
WORKDIR "/src/DiscordBot"
12-
RUN dotnet build "./DiscordBot.csproj" -c $BUILD_CONFIGURATION -o /app/build
11+
WORKDIR "/src/DisBot.DiscordBot"
12+
RUN dotnet build "./DisBot.DiscordBot.csproj" -c $BUILD_CONFIGURATION -o /app/build
1313

1414
FROM build AS publish
1515
ARG BUILD_CONFIGURATION=Release
16-
RUN dotnet publish "./DiscordBot.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
16+
RUN dotnet publish "./DisBot.DiscordBot.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
1717

1818
FROM base AS final
1919
WORKDIR /app
2020
COPY --from=publish /app/publish .
21-
ENTRYPOINT ["dotnet", "DiscordBot.dll"]
21+
ENTRYPOINT ["dotnet", "DisBot.DiscordBot.dll"]

0 commit comments

Comments
 (0)