diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..53fd471 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +**/bin/ +**/obj/ +.git +.env +.envrc diff --git a/.gitignore b/.gitignore index f0a5bec..d16919a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ # Created by https://www.toptal.com/developers/gitignore/api/dotnetcore,linux,visualstudiocode,rider,visualstudio,windows,macos # Edit at https://www.toptal.com/developers/gitignore?templates=dotnetcore,linux,visualstudiocode,rider,visualstudio,windows,macos +.env +.envrc + ### DotnetCore ### # .NET Core build folders bin/ diff --git a/.vscode/launch.json b/.vscode/launch.json index f73f02c..c84c173 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -14,7 +14,7 @@ "args": [ "{\"projectId\": \"03434ee1f1\", \"modelId\": \"base design\", \"versionId\": \"09d2a0e55a\", \"speckleServerUrl\": \"https://latest.speckle.systems\"}", "{\"speckleTypeToCount\": \"Base\"}", - "7e9d3a711fa422a0cfffd3f695f9024d3553016d3c" + "${env:SPECKLE_TOKEN}" ], "cwd": "${workspaceFolder}", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f5525a1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM mcr.microsoft.com/dotnet/sdk:7.0 as build-env + +WORKDIR /src +COPY *.csproj . +RUN dotnet restore --use-current-runtime +COPY . . +RUN dotnet publish --use-current-runtime --self-contained false --no-restore -o /publish + +FROM mcr.microsoft.com/dotnet/runtime:7.0 as runtime +WORKDIR /publish +COPY --from=build-env /publish . +RUN ls /publish +CMD ["dotnet", "SpeckleAutomateDotnetExample.dll"] \ No newline at end of file