| ; Sample supervisor config file. | |
| ; | |
| ; For more information on the config file, please see: | |
| ; http://supervisord.org/configuration.html | |
| ; | |
| ; Notes: | |
| ; - Shell expansion ("~" or "$HOME") is not supported. Environment | |
| ; variables can be expanded using this syntax: "%(ENV_HOME)s". | |
| ; - Quotes around values are not supported, except in the case of | |
| ; the environment= options as shown below. | |
| ; - Comments must have a leading space: "a=b ;comment" not "a=b;comment". | |
| ; - Command will be truncated if it looks like a config file comment, e.g. | |
| ; "command=bash -c 'foo ; bar'" will truncate to "command=bash -c 'foo ". | |
| ; | |
| ; Warning: | |
| ; Paths throughout this example file use /tmp because it is available on most | |
| ; systems. You will likely need to change these to locations more appropriate | |
| ; for your system. Some systems periodically delete older files in /tmp. | |
| ; Notably, if the socket file defined in the [unix_http_server] section below | |
| ; is deleted, supervisorctl will be unable to connect to supervisord. | |
| [inet_http_server] ; inet (TCP) server disabled by default | |
| port=127.0.0.1:9001 ; ip_address:port specifier, *:port for all iface | |
| username=%(ENV_SUPERVISOR_USERNAME)s ; default is no username (open server) | |
| password=%(ENV_SUPERVISOR_PASSWORD)s ; default is no password (open server) | |
| [supervisord] | |
| nodaemon=true | |
| user=user | |
| logfile=/app/log/supervisord.log | |
| pidfile=/var/run/supervisord.pid | |
| ; The rpcinterface:supervisor section must remain in the config file for | |
| ; RPC (supervisorctl/web interface) to work. Additional interfaces may be | |
| ; added by defining them in separate [rpcinterface:x] sections. | |
| [rpcinterface:supervisor] | |
| supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | |
| ; The supervisorctl section configures how supervisorctl will connect to | |
| ; supervisord. configure it match the settings in either the unix_http_server | |
| ; or inet_http_server section. | |
| [supervisorctl] | |
| serverurl=http://127.0.0.1:9001 ; use an http:// url to specify an inet socket | |
| username=%(ENV_SUPERVISOR_USERNAME)s ; should be same as in [*_http_server] if set | |
| password=%(ENV_SUPERVISOR_PASSWORD)s ; should be same as in [*_http_server] if set | |
| prompt=supervisor ; cmd line prompt (default "supervisor") | |
| history_file=/app/log/supervisor.sc_history ; use readline history if available | |
| [program:nginx] | |
| command=nginx -c "/app/nginx/nginx.conf" | |
| autostart=true | |
| autorestart=true | |
| stdout_logfile=/app/log/nginx_stdout.log | |
| stderr_logfile=/app/log/nginx_stderr.log | |
| [program:fastapi] | |
| command=uvicorn app_fast:app --reload --host 127.0.0.1 --port 8000 --log-level info | |
| directory=/app/app_fast | |
| autostart=true | |
| autorestart=true | |
| stdout_logfile=/app/log/fast_stdout.log | |
| stderr_logfile=/app/log/fast_stderr.log | |
| [program:mineru-api] | |
| command=mineru-api --host 127.0.0.1 --port 8100 | |
| directory=/app/data | |
| autostart=true | |
| autorestart=true | |
| stdout_logfile=/app/log/mineru-api_stdout.log | |
| stderr_logfile=/app/log/mineru-api_stderr.log | |
| [program:mineru-gradio] | |
| command=mineru-gradio --server-name 127.0.0.1 --server-port 8101 | |
| directory=/app/data | |
| autostart=true | |
| autorestart=true | |
| stdout_logfile=/app/log/mineru-gradio_stdout.log | |
| stderr_logfile=/app/log/mineru-gradio_stderr.log | |
| ;[program:ttyd] | |
| ; -p 8010 : 指定端口为 8010 | |
| ; -i 127.0.0.1 : 仅允许本机访问(防止外网直接绕过 Nginx 连接) | |
| ; -b /terminal : 设置基础路径,确保网页资源加载正常 | |
| ; -c admin:password : 设置管理员账号和密码 | |
| ;command=ttyd -p 8010 -i 127.0.0.1 -c %(ENV_SUPERVISOR_USERNAME)s:%(ENV_SUPERVISOR_PASSWORD)s -b /terminal bash | |
| ;directory=/app/app_fast | |
| ;autostart=true | |
| ;autorestart=true | |
| ;stdout_logfile=/app/log/fast_stdout.log | |
| ;stderr_logfile=/app/log/fast_stderr.log | |
| ;[program:flask] | |
| ;command=gunicorn app_flask:app --bind 127.0.0.1:5000 --workers 2 | |
| ;directory=/app/app_flask | |
| ;autostart=true | |
| ;autorestart=true | |
| ;stdout_logfile=/app/log/flask_stdout.log | |
| ;stderr_logfile=/app/log/flask_stderr.log | |
| [program:jupyterlab] | |
| command=jupyter lab --port=8001 --ip=127.0.0.1 --allow-root --no-browser --ServerApp.allow_remote_access=True --ServerApp.allow_origin='*' --IdentityProvider.token=%(ENV_SUPERVISOR_PASSWORD)s --ServerApp.allow_origin_pat='.*' --ServerApp.websocket_url='' --ServerApp.base_url='/jupyterlab/' | |
| ; --- 运行环境 --- | |
| directory=/app ; 工作目录,建议设为 /data 以利用持久化存储 | |
| ;user=root ; 运行用户 | |
| autostart=true ; 随 Supervisor 启动 | |
| autorestart=true ; 意外退出时自动重启 | |
| startsecs=5 ; 启动 5 秒后没有异常则认为进程正常 | |
| ; --- 日志配置 (关键) --- | |
| stdout_logfile=/app/log/jupyterlab_stdout.log | |
| stderr_logfile=/app/log/jupyterlab_stderr.log |