Docker & env
This commit is contained in:
parent
65553534d1
commit
0ea582f464
3 changed files with 31 additions and 2 deletions
|
@ -8,7 +8,7 @@ public class UmoEngine : IDisposable
|
|||
{
|
||||
if (isFilePath)
|
||||
{
|
||||
apiKey ??= Umogen.DEFAULT_API_KEY_FILE;
|
||||
apiKey ??= Environment.GetEnvironmentVariable("UMO_KEY_FILE") ?? Umogen.DEFAULT_API_KEY_FILE;
|
||||
if (!File.Exists(apiKey))
|
||||
{
|
||||
throw new ArgumentException($"No such file: {apiKey}");
|
||||
|
|
|
@ -11,7 +11,8 @@ public class DataContext : DbContext
|
|||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder o)
|
||||
{
|
||||
o.UseSqlite("Data Source=data.db;");
|
||||
|
||||
o.UseSqlite($"Data Source={Environment.GetEnvironmentVariable("UMO_DATA") ?? "data.db"};");
|
||||
}
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder m)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue