redaction (#1)
Add the redacted source file for demo purposes Reviewed-on: #1 Co-authored-by: Michael DiLeo <[email protected]> Co-committed-by: Michael DiLeo <[email protected]>
This commit was merged in pull request #1.
This commit is contained in:
1 parent
612235d52b
commit
7327d77dcd
333 files changed
+39286
-1
No files matched your search
@@ -0,0 +1,37 @@
|
||||
# BookWyrm Worker Container - Production Optimized
|
||||
# Celery background task processor
|
||||
|
||||
FROM bookwyrm-base AS bookwyrm-worker
|
||||
|
||||
# Switch to root for system package installation
|
||||
USER root
|
||||
|
||||
# Install only supervisor for worker management
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
supervisor \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& apt-get clean \
|
||||
&& apt-get autoremove -y
|
||||
|
||||
# Install Celery in virtual environment
|
||||
RUN /opt/venv/bin/pip install --no-cache-dir celery[redis]
|
||||
|
||||
# Copy worker-specific configuration
|
||||
COPY supervisord-worker.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY entrypoint-worker.sh /entrypoint.sh
|
||||
|
||||
# Set permissions efficiently
|
||||
RUN chmod +x /entrypoint.sh \
|
||||
&& mkdir -p /var/log/supervisor /var/log/celery \
|
||||
&& chown -R bookwyrm:bookwyrm /var/log/celery \
|
||||
&& chown -R bookwyrm:bookwyrm /app
|
||||
|
||||
# Health check for worker
|
||||
HEALTHCHECK --interval=60s --timeout=10s --start-period=60s --retries=3 \
|
||||
CMD /opt/venv/bin/celery -A celerywyrm inspect ping -d celery@$HOSTNAME || exit 1
|
||||
|
||||
# Run as root to manage celery via supervisor
|
||||
USER root
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
||||
Reference in new issue
Block a user