| FROM python:3.11-slim |
|
|
| ENV PYTHONDONTWRITEBYTECODE=1 |
| ENV PYTHONUNBUFFERED=1 |
| ENV GRADIO_SERVER_NAME=0.0.0.0 |
| ENV GRADIO_SERVER_PORT=7860 |
|
|
| WORKDIR /app |
|
|
| COPY requirements.txt /app/requirements.txt |
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| curl \ |
| git \ |
| r-base \ |
| r-base-dev \ |
| libcurl4-openssl-dev \ |
| libssl-dev \ |
| libxml2-dev \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| RUN pip install --no-cache-dir --upgrade pip && \ |
| pip install --no-cache-dir -r requirements.txt && \ |
| python -m ipykernel install --sys-prefix --name python3 --display-name "Python 3" |
|
|
| RUN Rscript -e "install.packages(c('IRkernel','ggplot2','dplyr','readr','forecast','tseries','tidyr','forcats','tibble'), repos='https://cloud.r-project.org')" && \ |
| Rscript -e "IRkernel::installspec(user = FALSE)" |
|
|
| COPY . /app |
|
|
| EXPOSE 7860 |
|
|
| CMD ["python", "-u", "app.py"] |
|
|