From 1e85d0ea42b8fa1f7e9ecf25aeb02e7c133052ab Mon Sep 17 00:00:00 2001 From: Chris Date: Fri, 20 Sep 2024 20:59:12 -0400 Subject: [PATCH] Add project files. --- .dockerignore | 30 +++++++++++++++++++ AnimeAnnouncer.sln | 25 ++++++++++++++++ AnimeAnnouncer/AnimeAnnouncer.csproj | 15 ++++++++++ AnimeAnnouncer/Dockerfile | 28 +++++++++++++++++ AnimeAnnouncer/Program.cs | 10 +++++++ AnimeAnnouncer/Properties/launchSettings.json | 10 +++++++ 6 files changed, 118 insertions(+) create mode 100644 .dockerignore create mode 100644 AnimeAnnouncer.sln create mode 100644 AnimeAnnouncer/AnimeAnnouncer.csproj create mode 100644 AnimeAnnouncer/Dockerfile create mode 100644 AnimeAnnouncer/Program.cs create mode 100644 AnimeAnnouncer/Properties/launchSettings.json diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fe1152b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/AnimeAnnouncer.sln b/AnimeAnnouncer.sln new file mode 100644 index 0000000..697e7b1 --- /dev/null +++ b/AnimeAnnouncer.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35303.130 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AnimeAnnouncer", "AnimeAnnouncer\AnimeAnnouncer.csproj", "{B6D808BF-954E-48C8-A37E-62A8AA4E06C0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B6D808BF-954E-48C8-A37E-62A8AA4E06C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B6D808BF-954E-48C8-A37E-62A8AA4E06C0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B6D808BF-954E-48C8-A37E-62A8AA4E06C0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B6D808BF-954E-48C8-A37E-62A8AA4E06C0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {294D78E9-973F-4D89-958F-CEF0E4D88FAE} + EndGlobalSection +EndGlobal diff --git a/AnimeAnnouncer/AnimeAnnouncer.csproj b/AnimeAnnouncer/AnimeAnnouncer.csproj new file mode 100644 index 0000000..e076340 --- /dev/null +++ b/AnimeAnnouncer/AnimeAnnouncer.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + enable + enable + Linux + + + + + + + diff --git a/AnimeAnnouncer/Dockerfile b/AnimeAnnouncer/Dockerfile new file mode 100644 index 0000000..d89dc82 --- /dev/null +++ b/AnimeAnnouncer/Dockerfile @@ -0,0 +1,28 @@ +# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. + +# This stage is used when running from VS in fast mode (Default for Debug configuration) +FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base +USER app +WORKDIR /app + + +# This stage is used to build the service project +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["AnimeAnnouncer/AnimeAnnouncer.csproj", "AnimeAnnouncer/"] +RUN dotnet restore "./AnimeAnnouncer/AnimeAnnouncer.csproj" +COPY . . +WORKDIR "/src/AnimeAnnouncer" +RUN dotnet build "./AnimeAnnouncer.csproj" -c $BUILD_CONFIGURATION -o /app/build + +# This stage is used to publish the service project to be copied to the final stage +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./AnimeAnnouncer.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration) +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "AnimeAnnouncer.dll"] \ No newline at end of file diff --git a/AnimeAnnouncer/Program.cs b/AnimeAnnouncer/Program.cs new file mode 100644 index 0000000..5e61698 --- /dev/null +++ b/AnimeAnnouncer/Program.cs @@ -0,0 +1,10 @@ +namespace AnimeAnnouncer +{ + internal class Program + { + static void Main(string[] args) + { + Console.WriteLine("Hello, World!"); + } + } +} diff --git a/AnimeAnnouncer/Properties/launchSettings.json b/AnimeAnnouncer/Properties/launchSettings.json new file mode 100644 index 0000000..fc053dc --- /dev/null +++ b/AnimeAnnouncer/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "AnimeAnnouncer": { + "commandName": "Project" + }, + "Container (Dockerfile)": { + "commandName": "Docker" + } + } +} \ No newline at end of file