summaryrefslogtreecommitdiffstats
path: root/docker/start.sh
diff options
context:
space:
mode:
authorJean-Philippe Roemer <roemer.jp@gmail.com>2015-10-12 16:39:40 +0100
committerJean-Philippe Roemer <roemer.jp@gmail.com>2015-10-12 18:46:45 +0100
commit9cba6ff84b703f1b8b69dc58caefb377cd835936 (patch)
treed494f85242f07172edfa886917f016092a5b197a /docker/start.sh
parent570ddefc3259b8bebebf6db6b7d9029b749358f9 (diff)
downloadgitea-9cba6ff84b703f1b8b69dc58caefb377cd835936.tar.gz
gitea-9cba6ff84b703f1b8b69dc58caefb377cd835936.zip
Volumed data setup changed to allow #1759
- Volumed subfolder now created up in the ENTRYPOINT script, this way they are created before S6 even starts making VOLUME. - The subfolder will be created during VOLUME creation too as ENTRYPOINT script will be run before /bin/true - SSH Keys will now be created on a single key basis not replying on the existence of /data/ssh folder
Diffstat (limited to 'docker/start.sh')
-rwxr-xr-xdocker/start.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/docker/start.sh b/docker/start.sh
index 9f1f41a9a4..c687515f5d 100755
--- a/docker/start.sh
+++ b/docker/start.sh
@@ -5,6 +5,13 @@
rm -rf $(find /app/gogs/docker/s6/ -name 'event')
rm -rf /app/gogs/docker/s6/SOCAT_*
+# Create VOLUME subfolder
+for f in /data/gogs/data /data/gogs/conf /data/gogs/log /data/git /data/ssh; do
+ if ! test -d $f; then
+ mkdir -p $f
+ fi
+done
+
# Bind linked docker container to localhost socket using socat
env | sed -En 's|(.*)_PORT_([0-9]*)_TCP=tcp://(.*):(.*)|\1_\2 socat -ls TCP4-LISTEN:\2,fork,reuseaddr TCP4:\3:\4|p' | \
while read NAME CMD; do