You've already forked Mailu
mirror of
https://github.com/Mailu/Mailu.git
synced 2025-11-23 22:04:47 +02:00
Use python package socrate instead of Mailustart
This commit is contained in:
@@ -3,8 +3,10 @@ FROM alpine:3.10
|
||||
RUN apk add --no-cache \
|
||||
python3 py3-pip bash \
|
||||
&& pip3 install --upgrade pip
|
||||
# Shared layer between rspamd, postfix, dovecot, unbound, rainloop, roundcube and nginx
|
||||
RUN pip3 install jinja2
|
||||
|
||||
# Shared layer between nginx, dovecot, postfix, postgresql, rspamd, unbound, rainloop, roundcube
|
||||
RUN pip3 install socrate
|
||||
|
||||
# Image specific layers under this line
|
||||
RUN apk add --no-cache \
|
||||
postgresql postgresql-libs busybox-suid sudo tar \
|
||||
|
||||
@@ -6,6 +6,7 @@ import jinja2
|
||||
import glob
|
||||
import os
|
||||
import subprocess
|
||||
from socrate import conf
|
||||
|
||||
def setup():
|
||||
conn = psycopg2.connect(user='postgres')
|
||||
@@ -47,9 +48,8 @@ os.system("mkdir -p /backup/wal_archive")
|
||||
os.system("chown -R postgres:postgres /backup")
|
||||
|
||||
# Render config files
|
||||
convert = lambda src, dst: open(dst, "w").write(jinja2.Template(open(src).read()).render(**os.environ))
|
||||
for pg_file in glob.glob("/conf/*.conf"):
|
||||
convert(pg_file, os.path.join("/data", os.path.basename(pg_file)))
|
||||
conf.jinja(pg_file, os.environ, os.path.join("/data", os.path.basename(pg_file)))
|
||||
|
||||
# (Re)start postgresql locally for DB and user creation
|
||||
os.system("sudo -u postgres pg_ctl start -D /data -o '-h \"''\" '")
|
||||
|
||||
Reference in New Issue
Block a user