File size: 1,591 Bytes
5605649 2076ba5 5605649 2076ba5 36520a0 5605649 2076ba5 5605649 36520a0 2076ba5 36520a0 5605649 0a571a6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | FROM python:3.10-slim
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860
# System deps: R + compilers + common R pkg build deps
RUN apt-get update && apt-get install -y --no-install-recommends \
r-base \
r-base-dev \
build-essential \
curl \
git \
libcurl4-openssl-dev \
libssl-dev \
libxml2-dev \
&& rm -rf /var/lib/apt/lists/*
# Install required R packages
RUN R -e "install.packages(c('forecast','ggplot2','jsonlite','readr','dplyr','tidyr','stringr','lubridate','broom'), repos='https://cloud.r-project.org')"
WORKDIR /app
COPY . /app
# Python deps (from requirements.txt)
RUN pip install --no-cache-dir -r requirements.txt
# Notebook execution deps (papermill + jupyter stack)
RUN pip install --no-cache-dir \
notebook \
papermill \
ipykernel \
nbclient \
nbformat \
jupyter_client
# Pre-install packages notebooks might install at runtime
RUN pip install --no-cache-dir textblob faker transformers
# ✅ Register Python kernel in the environment Jupyter uses
RUN python -m ipykernel install --sys-prefix --name python3 --display-name "Python 3"
# ✅ R deps for notebook execution via papermill (IRkernel) with explicit name "ir"
RUN R -e "install.packages('IRkernel', repos='https://cloud.r-project.org/')"
RUN R -e "IRkernel::installspec(name='ir', displayname='R (IRkernel)', user=FALSE)"
# (Optional but useful) show installed kernels during build
RUN jupyter kernelspec list
EXPOSE 7860
CMD ["python", "app.py"]
|