Add pgadmin config generator container

This commit is contained in:
Elliot Matson 2022-07-29 22:13:47 -05:00
parent 01e8633f12
commit 6f6e9012e4
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,6 @@
FROM python:3.8-alpine
RUN mkdir /app
RUN mkdir /config
ADD . /app
WORKDIR /app
CMD ["python", "app.py"]

View File

@ -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)