From 47f1b77584f43ccb5e8d5ac1a12bce841f709af5 Mon Sep 17 00:00:00 2001 From: lumijiez <59575049+lumijiez@users.noreply.github.com> Date: Fri, 6 Jun 2025 00:08:22 +0300 Subject: [PATCH] Use .env for all configs --- README.md | 8 ++++++++ docker-compose.yml | 10 +++++++--- src/Imprink.WebApi/appsettings.Development.json | 15 --------------- src/Imprink.WebApi/appsettings.json | 15 --------------- 4 files changed, 15 insertions(+), 33 deletions(-) delete mode 100644 src/Imprink.WebApi/appsettings.Development.json delete mode 100644 src/Imprink.WebApi/appsettings.json diff --git a/README.md b/README.md index 93b1bdb..0013122 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,14 @@ AUTH0_SCOPE=openid profile email AUTH0_DOMAIN=https://dev-example1234.us.auth0.com/ APP_BASE_URL=https://example.com +# ASP.NET Core Configuration +ASPNETCORE_ENVIRONMENT=Development +ASPNETCORE_URLS=http://+:8080 +ASPNETCORE_LOGGING_LEVEL_DEFAULT=Information +ASPNETCORE_LOGGING_LEVEL=Information +ASPNETCORE_LOGGING_LEVEL_EFCORE=Information +ASPNETCORE_APPLY_MIGRATIONS_AT_STARTUP=true + # Frontend Configuration NEXT_PUBLIC_API_URL=https://example.com/api NEXT_PUBLIC_AUTH0_DOMAIN=auth.example.com diff --git a/docker-compose.yml b/docker-compose.yml index 492a5b2..bf9ceb4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,11 +6,15 @@ services: expose: - "80" environment: - - ASPNETCORE_ENVIRONMENT=Development + - ASPNETCORE_ENVIRONMENT=${ASPNETCORE_ENVIRONMENT} - ConnectionStrings__DefaultConnection=Server=${SQL_SERVER};Database=${SQL_DATABASE};User Id=${SQL_USER_ID};Password=${SQL_PASSWORD};Encrypt=false;TrustServerCertificate=true;MultipleActiveResultSets=true; - - ASPNETCORE_URLS=http://+:8080 + - ASPNETCORE_URLS=${ASPNETCORE_URLS} - Auth0__Authority=${AUTH0_DOMAIN} - Auth0__Audience=${AUTH0_AUDIENCE} + - Logging__LogLevel__Default=${ASPNETCORE_LOGGING_LEVEL_DEFAULT} + - Logging__LogLevel__Microsoft.AspNetCore=${ASPNETCORE_LOGGING_LEVEL} + - Logging__LogLevel__Microsoft.EntityFrameworkCore=${ASPNETCORE_LOGGING_LEVEL_EFCORE} + - DatabaseOptions__ApplyMigrationsAtStartup=${ASPNETCORE_APPLY_MIGRATIONS_AT_STARTUP} depends_on: - mssql networks: @@ -23,7 +27,7 @@ services: - ./webui:/app - /app/node_modules ports: - - "3000:3000" + - "3000" environment: - NODE_ENV=development - AUTH0_SECRET=${AUTH0_SECRET} diff --git a/src/Imprink.WebApi/appsettings.Development.json b/src/Imprink.WebApi/appsettings.Development.json deleted file mode 100644 index 4a9cca5..0000000 --- a/src/Imprink.WebApi/appsettings.Development.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Debug", - "Microsoft.EntityFrameworkCore": "Information" - } - }, - "ConnectionStrings": { - "DefaultConnection": "" - }, - "DatabaseOptions": { - "ApplyMigrationsAtStartup": true - } -} \ No newline at end of file diff --git a/src/Imprink.WebApi/appsettings.json b/src/Imprink.WebApi/appsettings.json deleted file mode 100644 index 4a9cca5..0000000 --- a/src/Imprink.WebApi/appsettings.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft.AspNetCore": "Debug", - "Microsoft.EntityFrameworkCore": "Information" - } - }, - "ConnectionStrings": { - "DefaultConnection": "" - }, - "DatabaseOptions": { - "ApplyMigrationsAtStartup": true - } -} \ No newline at end of file