diff --git a/Dockerfile b/Dockerfile index 16482bc05683d56e3ef8315107fe606127c377bf..7bcb1f81e439d5287fba0d45dd2baa7273d6f82d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,6 +34,7 @@ RUN apt-get update && \ apt-get clean && \ npm install -g bower +COPY docker/entrypoint /usr/local/bin/entrypoint COPY docker/supervisord.conf /etc/supervisor/supervisord.conf COPY docker/supervisord-apache2.conf /etc/supervisor/conf.d/apache2.conf COPY docker/supervisord-lvalert-overseer.conf /etc/supervisor/conf.d/overseer.conf @@ -92,9 +93,11 @@ RUN useradd -M -u 50001 -g www-data -s /bin/false gracedb # set secure file/directory permissions. In particular, ADD command at # beginning of recipe inherits umask of user running the build -RUN chown gracedb:www-data /app/logs /app/project_data && \ +RUN chmod 0755 /usr/local/bin/entrypoint && \ + chown gracedb:www-data /app/logs /app/project_data && \ chmod 0750 /app/logs /app/project_data && \ find /app/gracedb_project -type d -exec chmod 0755 {} + && \ find /app/gracedb_project -type f -exec chmod 0644 {} + +ENTRYPOINT [ "/usr/local/bin/entrypoint" ] CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"] diff --git a/docker/entrypoint b/docker/entrypoint new file mode 100644 index 0000000000000000000000000000000000000000..9d8be7681826d0029095ddf2cd16ce16fdf1b769 --- /dev/null +++ b/docker/entrypoint @@ -0,0 +1,4 @@ +#!/bin/bash + +export LVALERT_OVERSEER_RESOURCE=${LVALERT_USER}_overseer_$(python -c 'import uuid; print(uuid.uuid4().hex)') +exec "$@" diff --git a/docker/supervisord-lvalert-overseer.conf b/docker/supervisord-lvalert-overseer.conf index 9074247aa172097220e4e1c4f77fb3572727f3c8..e3cf757406391a8f7abc571ddd2488f698d75dc8 100644 --- a/docker/supervisord-lvalert-overseer.conf +++ b/docker/supervisord-lvalert-overseer.conf @@ -1,6 +1,7 @@ [program:overseer] command=lvalert_overseer -a %(ENV_LVALERT_USER)s -b %(ENV_LVALERT_PASSWORD)s -s %(ENV_LVALERT_SERVER)s -p %(ENV_LVALERT_OVERSEER_PORT)s + -r %(ENV_LVALERT_OVERSEER_RESOURCE)s -l /tmp/overseer_stdout.log -e /tmp/overseer_stderr.log user=gracedb group=www-data