Skip to content
This repository has been archived by the owner on Mar 10, 2019. It is now read-only.

Easy use of custom settings #7

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ RUN apt-get update && apt-get install -y \
pkg-config \
python \
supervisor \

&& rm -rf /var/lib/apt/lists/*


Expand All @@ -30,9 +29,13 @@ RUN cd /opt && git clone https://github.com/ether/etherpad-lite.git etherpad
# Install node dependencies
RUN /opt/etherpad/bin/installDeps.sh

#mk dir for settins
RUN mkdir -p /opt/vol/

# Add conf files
ADD settings.json /opt/etherpad/settings.json
ADD supervisor.conf /etc/supervisor/supervisor.conf
ADD start.sh /usr/bin/start.sh

EXPOSE 9001
CMD ["supervisord", "-c", "/etc/supervisor/supervisor.conf", "-n"]
CMD ["start.sh"]
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ To run Etherpad on port 80, run:

`docker run -d -p 80:9001 leibnitius/etherpad-docker`

To edit the Etherpad settings.json, it is necessary to clone the Git repository:
To use your custom Etherpad settings.json, the file has to be located at `/var/config/settings.json`.
Then run:

`git clone git://github.com/ether/etherpad-docker.git && cd etherpad-docker`

Then edit the settings.json to your liking and run:

`docker build -t <YOUR_USERNAME>/etherpad-docker .`
`docker run -d -v /var/config:/opt/vol -p 9001:9001 leibnitius/etherpad-docker`

This image could also be used as a base for Docker Etherpad images integrated with MySQL, etc.
19 changes: 19 additions & 0 deletions start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

if [ -f /opt/vol/settings.json ]; then
echo "Volume with config was loaded"
echo "Using injected config…"
cp /opt/vol/settings.json /opt/etherpad/settings.json
else
echo "Using default config"
fi

if [ -f /opt/vol/APIKEY.txt ]; then
echo "Using custom apikey"
cp /opt/vol/APIKEY.txt /opt/etherpad/APIKEY.txt
else
echo "using generated api key"
cat /opt/etherpad/APIKEY.txt
fi

supervisord -c /etc/supervisor/supervisor.conf -n