memory/docker/workers/Dockerfile
2025-05-03 17:25:38 +02:00

34 lines
873 B
Docker

FROM python:3.11-slim
WORKDIR /app
# Copy requirements files and setup
COPY requirements-*.txt ./
COPY setup.py ./
COPY src/ ./src/
# Install dependencies
RUN apt-get update && apt-get install -y \
libpq-dev gcc pandoc \
texlive-full texlive-fonts-recommended texlive-plain-generic \
# For optional LibreOffice support (uncomment if needed)
# libreoffice-writer \
&& \
pip install -e ".[workers]" && \
apt-get purge -y gcc && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
# Create and copy entrypoint script
COPY docker/workers/entry.sh ./entry.sh
RUN chmod +x entry.sh
RUN mkdir -p /app/memory_files
# Create user and set permissions
RUN useradd -m kb && chown -R kb /app
USER kb
# Default queues to process
ENV QUEUES="medium_embed,photo_embed,low_ocr,git_summary,rss,docs,email"
ENV PYTHONPATH="/app"
ENTRYPOINT ["./entry.sh"]