diff --git a/Femto.Api/Dockerfile b/Femto.Api/Dockerfile index 097b28f..6456763 100644 --- a/Femto.Api/Dockerfile +++ b/Femto.Api/Dockerfile @@ -64,10 +64,11 @@ RUN mkdir -p /app/scripts && \ echo '#!/bin/sh\nexec dotnet /app/femto-db/Femto.Database.dll "$@"' > /app/scripts/femto-db && \ chmod +x /app/scripts/femto-db -# (Optional) Add script dir to PATH for easier access +# Optional: add script dir to PATH for easier access ENV PATH="/app/scripts:${PATH}" +# This envvar is used by Femto.Database up to load the migrations +ENV MIGRATIONS_DIRECTORY='/app/femto-db/Migrations' # Entrypoint for the API ENTRYPOINT ["dotnet", "Femto.Api.dll"] - diff --git a/Femto.Database/Program.cs b/Femto.Database/Program.cs index ba182d5..a542c8f 100644 --- a/Femto.Database/Program.cs +++ b/Femto.Database/Program.cs @@ -25,6 +25,8 @@ var connectionStringArg = new Argument( var connectionStringOption = new Option( ["-c", "--connection-string"], + + // we default this to the same variable used by the server application () => System.Environment.GetEnvironmentVariable("ConnectionStrings__Database") ?? null, "the connection string to the database" );