Added docker compose to build the project
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -459,3 +459,4 @@ $RECYCLE.BIN/
|
||||
/WebUI_Old/Data
|
||||
/WebUI/bin
|
||||
/WebUI_Old/bin
|
||||
Data/
|
||||
33
WebUI/Dockerfile
Normal file
33
WebUI/Dockerfile
Normal file
@@ -0,0 +1,33 @@
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
|
||||
USER $APP_UID
|
||||
WORKDIR /app
|
||||
EXPOSE 8080
|
||||
EXPOSE 8081
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
COPY ["WebUI/WebUI.csproj", "WebUI/"]
|
||||
COPY ["DiscordBotCore.Configuration/DiscordBotCore.Configuration.csproj", "DiscordBotCore.Configuration/"]
|
||||
COPY ["DiscordBotCore.Logging/DiscordBotCore.Logging.csproj", "DiscordBotCore.Logging/"]
|
||||
COPY ["DiscordBotCore.Database.Sqlite/DiscordBotCore.Database.Sqlite.csproj", "DiscordBotCore.Database.Sqlite/"]
|
||||
COPY ["DiscordBotCore.PluginManagement/DiscordBotCore.PluginManagement.csproj", "DiscordBotCore.PluginManagement/"]
|
||||
COPY ["DiscordBotCore.Networking/DiscordBotCore.Networking.csproj", "DiscordBotCore.Networking/"]
|
||||
COPY ["DiscordBotCore.Utilities/DiscordBotCore.Utilities.csproj", "DiscordBotCore.Utilities/"]
|
||||
COPY ["DiscordBotCore/DiscordBotCore.csproj", "DiscordBotCore/"]
|
||||
COPY ["DiscordBotCore.PluginCore/DiscordBotCore.PluginCore.csproj", "DiscordBotCore.PluginCore/"]
|
||||
COPY ["DiscordBotCore.PluginManagement.Loading/DiscordBotCore.PluginManagement.Loading.csproj", "DiscordBotCore.PluginManagement.Loading/"]
|
||||
RUN dotnet restore "WebUI/WebUI.csproj"
|
||||
COPY . .
|
||||
WORKDIR "/src/WebUI"
|
||||
RUN dotnet build "./WebUI.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./WebUI.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
EXPOSE 8080
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "WebUI.dll"]
|
||||
@@ -4,6 +4,7 @@
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -15,4 +16,10 @@
|
||||
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="..\.dockerignore">
|
||||
<Link>.dockerignore</Link>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,24 +1,10 @@
|
||||
services:
|
||||
# discord-bot-client:
|
||||
# build:
|
||||
# context: ./DiscordBot
|
||||
# dockerfile: Dockerfile
|
||||
# tty: true
|
||||
# stdin_open: true
|
||||
|
||||
discord-bot-webui:
|
||||
name: Seth Docker Build
|
||||
services:
|
||||
discord-bot:
|
||||
build:
|
||||
context: ./WebUI
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- '4444:8080'
|
||||
|
||||
|
||||
networks:
|
||||
custom_bridge:
|
||||
driver: bridge
|
||||
ipam:
|
||||
driver: default
|
||||
config:
|
||||
- subnet: "172.20.100.0/24"
|
||||
gateway: "172.20.100.1"
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
- ./Data:/app/Data
|
||||
Reference in New Issue
Block a user