mirror of
https://github.com/yawaflua/yaflay.ru.git
synced 2026-02-04 10:54:12 +02:00
finally fix environ
This commit is contained in:
@@ -21,7 +21,7 @@ ENV PSQL_HOST localhost
|
|||||||
ENV PSQL_USER root
|
ENV PSQL_USER root
|
||||||
ENV PSQL_PASSWORD root
|
ENV PSQL_PASSWORD root
|
||||||
ENV PSQL_DATABASE database
|
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
|
FROM base AS final
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
12
Program.cs
12
Program.cs
@@ -2,15 +2,13 @@ using Microsoft.AspNetCore.Hosting;
|
|||||||
using yaflay.ru;
|
using yaflay.ru;
|
||||||
public class Program
|
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;
|
var parse = (string name) => Environment.GetEnvironmentVariable(name) ?? null;
|
||||||
Startup.clientId = parse("clientId");
|
Startup.clientId = parse("CLIENTID");
|
||||||
Startup.clientSecret = parse("clientSecret");
|
Startup.clientSecret = parse("CLIENTSECRET");
|
||||||
Startup.redirectUrl = parse("redirectUrl");
|
Startup.redirectUrl = parse("REDIRECTURL");
|
||||||
Startup.connectionString = $"Host={parse("Host")};Username={parse("Username")};Password={parse("Password")};Database={parse("Database")}";
|
Startup.connectionString = $"Host={parse("PSQL_HOST")};Username={parse("PSQL_USER")};Password={parse("PSQL_PASSWORD")};Database={parse("PSQL_DATABASE")}";
|
||||||
Console.WriteLine(parse("CLIENTID"));
|
|
||||||
CreateHostBuilder()
|
CreateHostBuilder()
|
||||||
.Build()
|
.Build()
|
||||||
.Run();
|
.Run();
|
||||||
|
|||||||
Reference in New Issue
Block a user