Added /configuration volume with support for config.json and config.yml
This commit is contained in:
parent
76183c17a2
commit
3cdb9c3cc8
|
@ -5,6 +5,7 @@ USER app
|
|||
WORKDIR /app
|
||||
RUN mkdir ./files && chown app ./files
|
||||
VOLUME /app/files
|
||||
VOLUME /configuration
|
||||
EXPOSE 8080
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
||||
|
|
|
@ -9,7 +9,10 @@
|
|||
using Wave.Services;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
builder.Configuration.AddEnvironmentVariables("WAVE_");
|
||||
builder.Configuration
|
||||
.AddEnvironmentVariables("WAVE_")
|
||||
.AddJsonFile("/configuration/config.json", true, false)
|
||||
.AddYamlFile("/configuration/config.yml", true, false);
|
||||
|
||||
builder.Services.AddRazorComponents().AddInteractiveServerComponents();
|
||||
builder.Services.AddControllers();
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<PackageReference Include="Microsoft.Extensions.Options" Version="8.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="8.0.0" />
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.19.6" />
|
||||
<PackageReference Include="NetEscapades.Configuration.Yaml" Version="3.1.0" />
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ services:
|
|||
- "WAVE_ConnectionStrings__DefaultConnection=Host=db; Username=wave; Password=development"
|
||||
volumes:
|
||||
- wave-files:/app/files
|
||||
- wave-config:/configuration
|
||||
networks:
|
||||
- wave
|
||||
database:
|
||||
|
@ -32,6 +33,7 @@ services:
|
|||
|
||||
volumes:
|
||||
wave-files:
|
||||
wave-config:
|
||||
wave-db:
|
||||
networks:
|
||||
wave:
|
Loading…
Reference in a new issue