| FROM ubuntu:24.04 | |
| ARG DEV_MODE | |
| ENV DEV_MODE=${DEV_MODE:-false} | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| RUN apt update | |
| RUN apt install -y \ | |
| python3.12 \ | |
| python3.12-dev \ | |
| python3.12-venv \ | |
| python3-pip | |
| RUN ln -sf /usr/bin/python3 /usr/bin/python && ln -sf /usr/bin/pip3 /usr/bin/pip | |
| RUN apt install -y \ | |
| curl \ | |
| git \ | |
| git-lfs \ | |
| locales && \ | |
| git lfs install && \ | |
| sed -i 's/# \(en_US.UTF-8 UTF-8\)/\1/' /etc/locale.gen && \ | |
| locale-gen && \ | |
| rm -rf /var/lib/apt/lists/* | |
| RUN apt update && \ | |
| apt install -y nodejs npm && \ | |
| rm -rf /var/lib/apt/lists/* | |
| ENV LANG=en_US.UTF-8 \ | |
| LC_ALL=en_US.UTF-8 | |
| RUN curl -sSL https://install.python-poetry.org | python - && \ | |
| ln -sf ~/.local/bin/poetry /usr/local/bin/poetry | |
| RUN poetry config virtualenvs.in-project true | |
| WORKDIR /app | |
| EXPOSE 80 7860 | |
| COPY pyproject.toml poetry.lock* ./ | |
| RUN if [ "$DEV_MODE" = "false" ]; then \ | |
| echo "π Production mode: Clean build without cache"; \ | |
| poetry install --no-root --no-interaction --no-ansi --with data,ml,dev; \ | |
| fi | |
| COPY . /app | |
| RUN chmod +x /app/scripts/*.sh || true | |
| ENTRYPOINT ["/app/scripts/entrypoint.sh"] |