Skip to content

Instantly share code, notes, and snippets.

@bebehei
Last active January 7, 2018 15:23
Show Gist options
  • Save bebehei/88a1dbcb863e8cf62e72d8992ccf914a to your computer and use it in GitHub Desktop.
Save bebehei/88a1dbcb863e8cf62e72d8992ccf914a to your computer and use it in GitHub Desktop.
seafile container
root/boot/
root/lib/modules
root/usr/include/
root/usr/src/
root/usr/src/
root/var/log/
!root/var/log/nginx
!root/var/log/seafile
root/var/lib/apt
root/tmp/*

Seafile docker container

This is a seafile docker container to port your VM image installation in seafile fully.

Why?

Seafile is not properly dockerizeable, as I found in a PR VGoshev/seafile-docker#9

I had even a bigger try to fix this up, but I gave up on seafile. Personally, I will drop it in future. But I couldn't replace it that fast. I still had to dockerize it first.

usage

Rsync your server VM to root in this repo and then build the dockerimage. You may want to adapt the .dockerignore file first.

FROM scratch
ADD root/ /
ADD entrypoint.sh /entrypoint
USER "seafile"
ENTRYPOINT ["/entrypoint"]
#!/bin/bash
BASE=/srv/seafile
set -x
seafile_start() {
${BASE}/seafile-server-latest/seafile.sh start
sleep 5
}
seafile_stop() {
${BASE}/seafile-server-latest/seafile.sh stop
sleep 5
}
seafile_restart() {
seafile_stop
seafile_start
}
seahub_start() {
${BASE}/seafile-server-latest/seahub.sh start${FASTCGI:+"-fastcgi"}
sleep 5
}
seahub_stop() {
${BASE}/seafile-server-latest/seahub.sh stop
sleep 5
}
seahub_restart() {
seahub_stop
seahub_start
}
seafile_start
seahub_start
tail -f ${BASE}/logs/{ccnet,seafile,seahub,seahub_django_request}.log &
trap seafile_stop INT QUIT ABRT ALRM TERM TSTP
trap seafile_restart HUP
trap seahub_stop INT QUIT ABRT ALRM TERM TSTP
trap seahub_restart HUP
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment