mirror of
https://github.com/Mailu/Mailu.git
synced 2025-02-15 13:33:21 +02:00
Declare the data volume properly
This commit is contained in:
parent
79246cf2a3
commit
a2b5b4d2e0
@ -16,8 +16,12 @@ COPY start.py /start.py
|
||||
COPY conf /conf
|
||||
|
||||
ENV LANG en_US.UTF-8
|
||||
|
||||
RUN mkdir -p /var/lib/postgresql/data /run/postgresql \
|
||||
&& chown -R postgres:postgres /var/lib/postgresql/data /run/postgresql \
|
||||
&& chmod 2777 /run/postgresql
|
||||
|
||||
VOLUME /var/lib/postgresql/data
|
||||
EXPOSE 5432
|
||||
|
||||
RUN mkdir -p /run/postgresql && chown -R postgres:postgres /run/postgresql && chmod 2777 /run/postgresql
|
||||
|
||||
CMD /start.py
|
||||
|
@ -20,7 +20,7 @@ def setup():
|
||||
conn.close()
|
||||
|
||||
# Bootstrap the database if postgresql is running for the first time
|
||||
if not os.path.exists('/var/lib/postgresql/data/pg_hba.conf'):
|
||||
if not os.path.exists('/var/lib/postgresql/data/pg_wal'):
|
||||
os.system("chown -R postgres:postgres /var/lib/postgresql")
|
||||
os.system("su - postgres -c 'initdb -D /var/lib/postgresql/data'")
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user