Session_5_Update / Dockerfile
mariafrancescaalbanesi's picture
Update Dockerfile
df5b80d verified
raw
history blame contribute delete
864 Bytes
FROM python:3.11-slim
WORKDIR /app
# ---- System dependencies + R ----
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
git \
r-base \
&& rm -rf /var/lib/apt/lists/*
# ---- Python dependencies ----
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt \
notebook \
ipykernel \
papermill \
nbclient \
jupyter_client \
jupyter_core
# ---- Register Python kernel ----
RUN python -m ipykernel install --sys-prefix --name python3 --display-name "Python 3"
# ---- Install + register R kernel ----
RUN R -e "install.packages('IRkernel', repos='https://cloud.r-project.org/')"
RUN R -e "IRkernel::installspec(name='ir', displayname='R', user=FALSE)"
# ---- Copy project files ----
COPY . /app
EXPOSE 7860
CMD ["python", "app.py"]