diff --git a/pgadmin-config-creator/Dockerfile b/pgadmin-config-creator/Dockerfile new file mode 100644 index 0000000..779a0e2 --- /dev/null +++ b/pgadmin-config-creator/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.8-alpine +RUN mkdir /app +RUN mkdir /config +ADD . /app +WORKDIR /app +CMD ["python", "app.py"] \ No newline at end of file diff --git a/pgadmin-config-creator/app.py b/pgadmin-config-creator/app.py new file mode 100644 index 0000000..f3cc057 --- /dev/null +++ b/pgadmin-config-creator/app.py @@ -0,0 +1,10 @@ +import json +import os + +with open('/config/servers.json', 'w') as f: + print("created " + f.name) + template_string = '{"Servers": {"1": {"Name": "DavinciResolve", "Group": "Servers", "Port": 5432, "Username": "postgres", "Host": "postgres", "SSLMode": "prefer", "MaintenanceDB": "postgres"}}}' + data = json.loads(template_string) + data["Servers"]["1"]["Username"]=os.getenv("POSTGRES_USER") + print(data) + json.dump(data, f, indent=2) \ No newline at end of file