-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Settings class & Docker setup, add TwitchWorker tests
Renamed `OpenAI` and `Twitch` classes to `OpenAISettings` and `TwitchSettings` respectively, and updated the `Settings` class and all related code as needed. The Docker setup has been adjusted to use a two-staged build and run process to better separate build and runtime environments. Added a new empty test class `TwitchWorkerTests` for future use.
- Loading branch information
1 parent
e17f953
commit 3249144
Showing
9 changed files
with
40 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,18 @@ | ||
FROM mcr.microsoft.com/dotnet/runtime:8.0-bookworm-slim AS base | ||
USER $APP_UID | ||
# Stage 1: Build the application | ||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env | ||
WORKDIR /app | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0-bookworm-slim AS build | ||
ARG BUILD_CONFIGURATION=Release | ||
WORKDIR /src | ||
COPY ["GolfClapBot/GolfClapBot.Runner.csproj", "GolfClapBot/"] | ||
RUN dotnet restore "GolfClapBot/GolfClapBot.Runner.csproj" | ||
COPY . . | ||
WORKDIR "/src/Volvox.Twitch.Responder" | ||
RUN dotnet build "GolfClapBot.Runner.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||
# Copy csproj and restore as distinct layers | ||
COPY src/GolfClapBot.Runner/*.csproj ./src/GolfClapBot.Runner/ | ||
RUN dotnet restore src/GolfClapBot.Runner/GolfClapBot.Runner.csproj | ||
|
||
FROM build AS publish | ||
ARG BUILD_CONFIGURATION=Release | ||
RUN dotnet publish "GolfClapBot.Runner.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||
# Copy everything else and build | ||
COPY src/GolfClapBot.Runner/ ./src/GolfClapBot.Runner/ | ||
WORKDIR /app/src/GolfClapBot.Runner | ||
RUN dotnet build -c Release -o out | ||
|
||
FROM base AS final | ||
# Stage 2: Run the application | ||
FROM mcr.microsoft.com/dotnet/runtime:8.0 | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "GolfClapBot.dll"] | ||
COPY --from=build-env /app/src/GolfClapBot.Runner/out . | ||
ENTRYPOINT ["dotnet", "GolfClapBot.Runner.dll"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# Define the image name | ||
IMAGE_NAME=GolfClapBot | ||
|
||
# Build the Docker image | ||
docker build -t $IMAGE_NAME . | ||
|
||
# Run the Docker container | ||
docker run -d -p 8080:80 --name GolfClapBot $IMAGE_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...olfClapBot.Domain/Configuration/OpenAI.cs → ...ot.Domain/Configuration/OpenAISettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...olfClapBot.Domain/Configuration/Twitch.cs → ...ot.Domain/Configuration/TwitchSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace GolfClapBot.Test; | ||
|
||
public class TwitchWorkerTests | ||
{ | ||
} |