Marc Kupietz | 1f7dd6e | 2024-02-05 06:45:01 +0100 | [diff] [blame] | 1 | # Use the official Python 3.12 image |
| 2 | FROM python:3.12-slim-bookworm |
Marc Kupietz | 90db822 | 2024-02-01 18:07:04 +0100 | [diff] [blame] | 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" |
Marc Kupietz | 1f7dd6e | 2024-02-05 06:45:01 +0100 | [diff] [blame] | 9 | ENV MAKEFLAGS="-j$(nproc)" |
Marc Kupietz | 90db822 | 2024-02-01 18:07:04 +0100 | [diff] [blame] | 10 | |
| 11 | # Set the working directory |
| 12 | COPY lib /app/lib |
| 13 | COPY requirements.txt /app/requirements.txt |
| 14 | COPY systems /app/systems |
| 15 | COPY my_utils /app/my_utils |
| 16 | WORKDIR /app |
| 17 | |
| 18 | # Install Python dependencies and create a virtual environment |
| 19 | RUN mkdir -p "/app/logs" |
| 20 | RUN python -m venv venv |
Marc Kupietz | 1f7dd6e | 2024-02-05 06:45:01 +0100 | [diff] [blame] | 21 | RUN venv/bin/pip install --upgrade pip |
| 22 | RUN venv/bin/pip install -r requirements.txt |
Marc Kupietz | 90db822 | 2024-02-01 18:07:04 +0100 | [diff] [blame] | 23 | RUN . venv/bin/activate && python -m spacy download de_core_news_lg |
| 24 | |
| 25 | # Define the entry point |
| 26 | CMD ["python", "/app/systems/parse_spacy_pipe.py"] |
| 27 | |
| 28 | |