Commit 69527d5c authored by Jordi Mallach's avatar Jordi Mallach 🔥 Committed by Maxime Buquet

Add a script that initialises a Postgresql DB

parent 1ecc9b1f
......@@ -20,13 +20,14 @@ RUN apt-get update && apt-get install -y \
libssl-dev \
pkg-config \
python \
sudo \
supervisor \
&& rm -rf /var/lib/apt/lists/*
# Grab the latest Git version
RUN mkdir -p /srv/etherpad.collabora.com && cd /srv/etherpad.collabora.com && git clone https://gitlab.collabora.com/sysadmin/etherpad-lite.git etherpad
RUN mkdir -p /srv/etherpad.collabora.com/bin && cd /srv/etherpad.collabora.com && git clone https://gitlab.collabora.com/sysadmin/etherpad-lite.git etherpad
# Install node dependencies
RUN /srv/etherpad.collabora.com/etherpad/bin/installDeps.sh
......@@ -34,6 +35,8 @@ RUN /srv/etherpad.collabora.com/etherpad/bin/installDeps.sh
# Add conf files
ADD settings.json.collabora /srv/etherpad.collabora.com/etherpad/settings.json
ADD supervisor.conf /etc/supervisor/supervisor.conf
ADD init_pgsql_db /srv/etherpad.collabora.com/bin
EXPOSE 9001
CMD ["/srv/etherpad.collabora.com/bin/init_pgsql_db"]
CMD ["supervisord", "-c", "/etc/supervisor/supervisor.conf", "-n"]
#/bin/sh
set -e
if ! sudo -u postgres psql -l |grep "^ etherpad "; then
sudo -u postgres createuser etherpad
echo "ALTER USER etherpad WITH PASSWORD 'eet4kaeYpoL9Aesh';" |sudo -u postgres psql
echo "CREATE DATABASE etherpad OWNER etherpad;" | sudo -u postgres psql
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment