93 lines
3.0 KiB
Plaintext
93 lines
3.0 KiB
Plaintext
; Supervisord configuration for single-container Seafile stack
|
|
; Rendered by entrypoint.sh -> /etc/supervisor/supervisord.conf
|
|
|
|
[supervisord]
|
|
nodaemon=true
|
|
user=root
|
|
logfile={{LOG_DIR}}/supervisor/supervisord.log
|
|
pidfile=/run/supervisord.pid
|
|
childlogdir={{LOG_DIR}}/supervisor
|
|
logfile_maxbytes=50MB
|
|
logfile_backups=5
|
|
|
|
[supervisorctl]
|
|
serverurl=unix:///run/supervisor.sock
|
|
|
|
[unix_http_server]
|
|
file=/run/supervisor.sock
|
|
chmod=0700
|
|
|
|
; ------------ Programs ------------
|
|
|
|
; 1) MariaDB
|
|
[program:mariadb]
|
|
command=/usr/sbin/mariadbd --datadir=/data/db --socket=/run/mysqld/mysqld.sock --bind-address=127.0.0.1 --skip-name-resolve --skip-symbolic-links --log-bin=OFF --user=mysql
|
|
autostart=true
|
|
autorestart=true
|
|
startretries=10
|
|
startsecs=5
|
|
priority=10
|
|
stdout_logfile={{LOG_DIR}}/mariadb/stdout.log
|
|
stderr_logfile={{LOG_DIR}}/mariadb/stderr.log
|
|
stdout_logfile_maxbytes=20MB
|
|
stderr_logfile_maxbytes=20MB
|
|
environment=MYSQL_UNIX_PORT="/run/mysqld/mysqld.sock"
|
|
|
|
; 2) Redis
|
|
[program:redis]
|
|
command=/usr/bin/redis-server /etc/redis/redis.conf
|
|
autostart=true
|
|
autorestart=true
|
|
startretries=10
|
|
startsecs=2
|
|
priority=20
|
|
stdout_logfile={{LOG_DIR}}/redis/stdout.log
|
|
stderr_logfile={{LOG_DIR}}/redis/stderr.log
|
|
stdout_logfile_maxbytes=20MB
|
|
stderr_logfile_maxbytes=20MB
|
|
|
|
; 3) Seafile Core + Fileserver (via seafile.sh -> seafile-controller)
|
|
[program:seafile]
|
|
command=/bin/bash -lc "for i in {1..60}; do /usr/bin/mysqladmin --protocol=socket --socket=/run/mysqld/mysqld.sock ping --silent && break || sleep 1; done; {{SEAF_RELEASE_DIR}}/seafile.sh start"
|
|
directory={{SEAF_RELEASE_DIR}}
|
|
user=seafile
|
|
autostart=true
|
|
autorestart=true
|
|
startretries=10
|
|
startsecs=8
|
|
priority=30
|
|
stdout_logfile={{LOG_DIR}}/seafile/seafile.stdout.log
|
|
stderr_logfile={{LOG_DIR}}/seafile/seafile.stderr.log
|
|
stdout_logfile_maxbytes=50MB
|
|
stderr_logfile_maxbytes=50MB
|
|
environment=CCNET_CONF_DIR="{{SEAFILE_CONF_DIR}}",SEAFILE_CONF_DIR="{{SEAFILE_CONF_DIR}}",SEAFILE_CENTRAL_CONF_DIR="{{SEAFILE_CONF_DIR}}",SEAFILE_DATA_DIR="{{SEAFILE_DATA_DIR}}"
|
|
|
|
; 4) Seahub via Gunicorn
|
|
[program:seahub]
|
|
command=/bin/bash -lc "/opt/seafile/docker/init_seahub.sh && exec /opt/seafile/venv/bin/gunicorn -c /opt/seafile/docker/gunicorn.conf.py seahub.wsgi:application"
|
|
directory={{SEAF_RELEASE_DIR}}/seahub
|
|
user=seafile
|
|
autostart=true
|
|
autorestart=true
|
|
startretries=10
|
|
startsecs=8
|
|
priority=40
|
|
stdout_logfile={{LOG_DIR}}/seahub/gunicorn.stdout.log
|
|
stderr_logfile={{LOG_DIR}}/seahub/gunicorn.stderr.log
|
|
stdout_logfile_maxbytes=50MB
|
|
stderr_logfile_maxbytes=50MB
|
|
environment=DJANGO_SETTINGS_MODULE="seahub.settings",PYTHONPATH="{{SEAF_RELEASE_DIR}}",CCNET_CONF_DIR="{{SEAFILE_CONF_DIR}}",SEAFILE_CONF_DIR="{{SEAFILE_CONF_DIR}}",SEAFILE_CENTRAL_CONF_DIR="{{SEAFILE_CONF_DIR}}",SEAFILE_DATA_DIR="{{SEAFILE_DATA_DIR}}"
|
|
|
|
; 5) Nginx
|
|
[program:nginx]
|
|
command=/usr/sbin/nginx -g "daemon off;"
|
|
autostart=true
|
|
autorestart=true
|
|
startretries=10
|
|
startsecs=2
|
|
priority=50
|
|
stdout_logfile={{LOG_DIR}}/nginx/stdout.log
|
|
stderr_logfile={{LOG_DIR}}/nginx/stderr.log
|
|
stdout_logfile_maxbytes=20MB
|
|
stderr_logfile_maxbytes=20MB
|