| # Use the official Python 3.11 image |
| FROM python:3.11-slim-bookworm |
| |
| # Set environment variables |
| ENV PIP_CACHE_DIR="/app/.cache/pip" \ |
| PYTHONPATH="PYTHONPATH:." |
| ENV VIRTUAL_ENV=/app/venv |
| ENV PATH="$VIRTUAL_ENV/bin:$PATH" |
| |
| # Set the working directory |
| COPY lib /app/lib |
| COPY requirements.txt /app/requirements.txt |
| COPY systems /app/systems |
| COPY my_utils /app/my_utils |
| WORKDIR /app |
| |
| # Install Python dependencies and create a virtual environment |
| RUN mkdir -p "/app/logs" |
| RUN python -m venv venv |
| RUN cp $(find / -name longintrepr.h) /usr/local/include/python3.11/ |
| RUN venv/bin/pip install --use-pep517 -r requirements.txt |
| RUN . venv/bin/activate && python -m spacy download de_core_news_lg |
| |
| # Define the entry point |
| CMD ["python", "/app/systems/parse_spacy_pipe.py"] |
| |
| |