Add pgadmin config generator container
This commit is contained in:
parent
01e8633f12
commit
6f6e9012e4
6
pgadmin-config-creator/Dockerfile
Normal file
6
pgadmin-config-creator/Dockerfile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM python:3.8-alpine
|
||||||
|
RUN mkdir /app
|
||||||
|
RUN mkdir /config
|
||||||
|
ADD . /app
|
||||||
|
WORKDIR /app
|
||||||
|
CMD ["python", "app.py"]
|
10
pgadmin-config-creator/app.py
Normal file
10
pgadmin-config-creator/app.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user