diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cd967fc --- /dev/null +++ b/.dockerignore @@ -0,0 +1,25 @@ +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/.idea +**/*.*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 \ No newline at end of file diff --git a/CLI/CLI.csproj b/CLI/CLI.csproj new file mode 100644 index 0000000..893e7f4 --- /dev/null +++ b/CLI/CLI.csproj @@ -0,0 +1,18 @@ + + + + Exe + net8.0 + default + enable + enable + Linux + + + + + .dockerignore + + + + diff --git a/CLI/Dockerfile b/CLI/Dockerfile new file mode 100644 index 0000000..dd919a3 --- /dev/null +++ b/CLI/Dockerfile @@ -0,0 +1,21 @@ +FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base +USER $APP_UID +WORKDIR /app + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["CLI/CLI.csproj", "CLI/"] +RUN dotnet restore "CLI/CLI.csproj" +COPY . . +WORKDIR "/src/CLI" +RUN dotnet build "./CLI.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./CLI.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "CLI.dll"] diff --git a/CLI/Program.cs b/CLI/Program.cs new file mode 100644 index 0000000..139ec4e --- /dev/null +++ b/CLI/Program.cs @@ -0,0 +1,3 @@ +// See https://aka.ms/new-console-template for more information + +Console.WriteLine("Hello, World!"); diff --git a/CivicVisualizer.sln b/CivicVisualizer.sln index 58ea566..b4b482d 100644 --- a/CivicVisualizer.sln +++ b/CivicVisualizer.sln @@ -3,6 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31903.59 MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CLI", "CLI\CLI.csproj", "{57EED8E1-B208-48F9-800E-855090E32579}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{562EE4BD-499F-47EE-A9A3-16DC2DF9FBA1}" + ProjectSection(SolutionItems) = preProject + compose.yaml = compose.yaml + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -11,4 +18,10 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {57EED8E1-B208-48F9-800E-855090E32579}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57EED8E1-B208-48F9-800E-855090E32579}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57EED8E1-B208-48F9-800E-855090E32579}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57EED8E1-B208-48F9-800E-855090E32579}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection EndGlobal diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..39ee7b7 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,7 @@ +services: + cli: + image: cli + build: + context: . + dockerfile: CLI/Dockerfile +