redaction (#1)
Add the redacted source file for demo purposes Reviewed-on: https://source.michaeldileo.org/michael_dileo/Keybard-Vagabond-Demo/pulls/1 Co-authored-by: Michael DiLeo <michael_dileo@proton.me> Co-committed-by: Michael DiLeo <michael_dileo@proton.me>
This commit was merged in pull request #1.
This commit is contained in:
37
build/bookwyrm/bookwyrm-worker/Dockerfile
Normal file
37
build/bookwyrm/bookwyrm-worker/Dockerfile
Normal file
@@ -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