Marc Kupietz | 90db822 | 2024-02-01 18:07:04 +0100 | [diff] [blame] | 1 | # Use the official Python 3.11 image |
| 2 | FROM python:3.11-slim-bookworm |
| 3 | |
| 4 | # Set environment variables |
| 5 | ENV PIP_CACHE_DIR="/app/.cache/pip" \ |
| 6 | PYTHONPATH="PYTHONPATH:." |
| 7 | ENV VIRTUAL_ENV=/app/venv |
| 8 | ENV PATH="$VIRTUAL_ENV/bin:$PATH" |
| 9 | |
| 10 | # Set the working directory |
| 11 | COPY lib /app/lib |
| 12 | COPY requirements.txt /app/requirements.txt |
| 13 | COPY systems /app/systems |
| 14 | COPY my_utils /app/my_utils |
| 15 | WORKDIR /app |
| 16 | |
| 17 | # Install Python dependencies and create a virtual environment |
| 18 | RUN mkdir -p "/app/logs" |
| 19 | RUN python -m venv venv |
| 20 | RUN cp $(find / -name longintrepr.h) /usr/local/include/python3.11/ |
| 21 | RUN venv/bin/pip install --use-pep517 -r requirements.txt |
| 22 | RUN . venv/bin/activate && python -m spacy download de_core_news_lg |
| 23 | |
| 24 | # Define the entry point |
| 25 | CMD ["python", "/app/systems/parse_spacy_pipe.py"] |
| 26 | |
| 27 | |