Skip to content

Commit

Permalink
Remove working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
gitfool committed Apr 26, 2024
1 parent 703ec59 commit c92ec7f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
10 changes: 4 additions & 6 deletions Cli/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,12 @@ EOF
# Install dungeon
ENV DOTNET_HostBuilder__ReloadConfigOnChange=false

WORKDIR /home/user/dungeon

COPY --link --chown=1000:1000 bin/Release/publish .
COPY --link --chown=1000:1000 bin/Release/publish /app

RUN <<EOF
set -ex
echo "alias d='cd ~/dungeon && dotnet bgg-dungeon.dll'" >> ~/.bash_aliases
find . -type f -regextype posix-egrep -iregex '.*\.(dll|json|yaml)$' -exec chmod -x {} \;
echo "alias d='dotnet /app/bgg-dungeon.dll'" >> ~/.bash_aliases
find /app -type f -regextype posix-egrep -iregex '.*\.(dll|json|yaml)$' -exec chmod -x {} \;
EOF

ENTRYPOINT [ "dotnet", "bgg-dungeon.dll" ]
ENTRYPOINT [ "dotnet", "/app/bgg-dungeon.dll" ]
1 change: 1 addition & 0 deletions Cli/GlobalUsings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
global using System.Net;
global using System.Net.Http;
global using System.Net.Http.Formatting;
global using System.Reflection;
global using System.Runtime.CompilerServices;
global using System.Text;
global using System.Text.Json.Serialization;
Expand Down
5 changes: 3 additions & 2 deletions Cli/HostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ public static IHostBuilder ConfigureAppConfiguration(this IHostBuilder hostBuild
((List<IConfigurationSource>)builder.Sources).RemoveAll(
source => source.GetType() == typeof(EnvironmentVariablesConfigurationSource) || source.GetType() == typeof(CommandLineConfigurationSource));

builder.AddYamlFile("config/_default.yaml", false, false) // global defaults
.AddYamlFile($"config/_{context.HostingEnvironment.EnvironmentName.ToLowerInvariant()}.yaml", true, false); // dotnet environment; development, production
var appRoot = Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location)!;
builder.AddYamlFile(Path.Combine(appRoot, "config", "_default.yaml"), false, false) // global defaults
.AddYamlFile(Path.Combine(appRoot, "config", $"_{context.HostingEnvironment.EnvironmentName.ToLowerInvariant()}.yaml"), true, false); // dotnet environment; development, production

builder.AddEnvironmentVariables() // env vars
.AddCommandLine(args); // cli
Expand Down

0 comments on commit c92ec7f

Please sign in to comment.