mirror of
https://github.com/yawaflua/yaflay.ru.git
synced 2025-12-09 20:19:32 +02:00
finally fix environ
This commit is contained in:
@@ -21,7 +21,7 @@ ENV PSQL_HOST localhost
|
||||
ENV PSQL_USER root
|
||||
ENV PSQL_PASSWORD root
|
||||
ENV PSQL_DATABASE database
|
||||
RUN dotnet publish "yaflay.ru.csproj" -c Release -o /app/publish /p:UseAppHost=false;redirectUrl=$CLIENTID;clientId=;clientSecret=$CLIENTSECRET;Host=$PSQL_HOST;Username=$PSQL_USER;Password=$PSQL_PASSWORD;Database=$PSQL_DATABASE
|
||||
RUN dotnet publish "yaflay.ru.csproj" -c Release -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
|
||||
12
Program.cs
12
Program.cs
@@ -2,15 +2,13 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using yaflay.ru;
|
||||
public class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
public static void Main()
|
||||
{
|
||||
Console.WriteLine(args[0]);
|
||||
var parse = (string name) => Environment.GetEnvironmentVariable(name) ?? null;
|
||||
Startup.clientId = parse("clientId");
|
||||
Startup.clientSecret = parse("clientSecret");
|
||||
Startup.redirectUrl = parse("redirectUrl");
|
||||
Startup.connectionString = $"Host={parse("Host")};Username={parse("Username")};Password={parse("Password")};Database={parse("Database")}";
|
||||
Console.WriteLine(parse("CLIENTID"));
|
||||
Startup.clientId = parse("CLIENTID");
|
||||
Startup.clientSecret = parse("CLIENTSECRET");
|
||||
Startup.redirectUrl = parse("REDIRECTURL");
|
||||
Startup.connectionString = $"Host={parse("PSQL_HOST")};Username={parse("PSQL_USER")};Password={parse("PSQL_PASSWORD")};Database={parse("PSQL_DATABASE")}";
|
||||
CreateHostBuilder()
|
||||
.Build()
|
||||
.Run();
|
||||
|
||||
Reference in New Issue
Block a user