Skip to content

Commit

Permalink
Merge branch 'ckan-2.10-upgrade' of github.com:TNRIS/twdh_ckan_docker…
Browse files Browse the repository at this point in the history
… into ckan-2.10-upgrade
  • Loading branch information
twdbben committed Dec 11, 2024
2 parents 409509a + d071ac4 commit 88ff660
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docker/ckan/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,11 @@ RUN ckan config-tool ${APP_DIR}/production.ini "ckan.plugins = ${CKAN__PLUGINS}"
ckan config-tool ${APP_DIR}/production.ini "googleanalytics.download_handler = ckanext.s3filestore.views:resource_download" && \
# Change ownership to app user
chown -R ckan:ckan /srv/app && \
# Setup supervisor
cp -v /srv/app/src/ckan/ckanext-twdh_theme/ckanext/twdh_theme/config/supervisor-ckan-worker.conf /etc/supervisor/conf.d/ && \
mkdir -v /var/log/ckan

# Setup supervisor
COPY ./supervisord.conf /etc/supervisor/
COPY ./supervisor-ckan-worker.conf /etc/supervisor/conf.d/

# install Rust, then qsvdp
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
Expand Down
44 changes: 44 additions & 0 deletions docker/ckan/supervisor-ckan-worker.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
; =======================================================
; Supervisor configuration for CKAN background job worker
; =======================================================

; 1. Copy this file to /etc/supervisor/conf.d
; 2. Make sure the paths below match your setup


[program:ckan-worker]

; Use the full paths to the virtualenv and your configuration file here.
; command=/usr/lib/ckan/default/bin/ckan -c /etc/ckan/default/ckan.ini jobs worker
command=/srv/app/virtualenv/bin/ckan -c production.ini jobs worker


; User the worker runs as.
; user=www-data
user=ckan


; Start just a single worker. Increase this number if you have many or
; particularly long running background jobs.
numprocs=1
process_name=%(program_name)s-%(process_num)02d


; Log files.
stdout_logfile=/var/log/ckan/ckan-worker.stdout.log
stderr_logfile=/var/log/ckan/ckan-worker.stderr.log


; Make sure that the worker is started on system start and automatically
; restarted if it crashes unexpectedly.
autostart=true
autorestart=true


; Number of seconds the process has to run before it is considered to have
; started successfully.
startsecs=10

; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600
23 changes: 23 additions & 0 deletions docker/ckan/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[unix_http_server]
file = /tmp/supervisor.sock
chmod = 0777
chown = nobody:nogroup

[supervisord]
logfile = /tmp/supervisord.log
logfile_maxbytes = 50MB
logfile_backups=10
loglevel = info
pidfile = /tmp/supervisord.pid
nodaemon = true
umask = 022
identifier = supervisor

[supervisorctl]
serverurl = unix:///tmp/supervisor.sock

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[include]
files = /etc/supervisor/conf.d/*

0 comments on commit 88ff660

Please sign in to comment.