rohan965 commited on
Commit
d9d775d
·
verified ·
1 Parent(s): b209d6c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -18
Dockerfile CHANGED
@@ -1,14 +1,20 @@
1
- # ============================================================
2
- FROM python:3.11-slim
3
 
4
- # ---- System dependencies ----
5
- # Key additions vs your previous Dockerfile:
6
- # - libopenblas-dev, liblapack-dev: required to compile glmnet reliably
 
 
 
 
 
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
- build-essential \
9
- gfortran \
10
  r-base \
11
  r-base-dev \
 
 
 
 
12
  libcurl4-openssl-dev \
13
  libssl-dev \
14
  libxml2-dev \
@@ -16,21 +22,26 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
16
  liblapack-dev \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
- # ---- R packages ----
20
- # Set CRAN mirror explicitly + install packages
21
  RUN R -e "options(repos=c(CRAN='https://cloud.r-project.org')); install.packages(c('jsonlite','Matrix','pROC','glmnet'), Ncpus=max(1, parallel::detectCores()-1))"
22
 
23
- # ---- IRkernel (so papermill can run the R notebook kernel 'ir') ----
24
- RUN R -e "options(repos=c(CRAN='https://cloud.r-project.org')); install.packages('IRkernel'); IRkernel::installspec(user = FALSE)"
25
-
26
- # ---- Python deps ----
27
  WORKDIR /app
28
- COPY requirements.txt /app/requirements.txt
29
- RUN pip install --no-cache-dir -r /app/requirements.txt
30
- RUN pip install --no-cache-dir jupyter ipykernel
31
-
32
- # ---- Copy project files ----
33
  COPY . /app
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  EXPOSE 7860
36
  CMD ["python", "app.py"]
 
1
+ FROM python:3.10-slim
 
2
 
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+ ENV PYTHONDONTWRITEBYTECODE=1
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ ENV GRADIO_SERVER_NAME=0.0.0.0
8
+ ENV GRADIO_SERVER_PORT=7860
9
+
10
+ # System deps: R + compilers + common R pkg build deps (+ BLAS/LAPACK for glmnet)
11
  RUN apt-get update && apt-get install -y --no-install-recommends \
 
 
12
  r-base \
13
  r-base-dev \
14
+ build-essential \
15
+ gfortran \
16
+ curl \
17
+ git \
18
  libcurl4-openssl-dev \
19
  libssl-dev \
20
  libxml2-dev \
 
22
  liblapack-dev \
23
  && rm -rf /var/lib/apt/lists/*
24
 
25
+ # Install required R packages (include glmnet + pROC + Matrix)
 
26
  RUN R -e "options(repos=c(CRAN='https://cloud.r-project.org')); install.packages(c('jsonlite','Matrix','pROC','glmnet'), Ncpus=max(1, parallel::detectCores()-1))"
27
 
 
 
 
 
28
  WORKDIR /app
 
 
 
 
 
29
  COPY . /app
30
 
31
+ # Python deps (from requirements.txt)
32
+ RUN pip install --no-cache-dir -r requirements.txt
33
+
34
+ # Notebook execution deps
35
+ RUN pip install --no-cache-dir notebook ipykernel papermill
36
+
37
+ # Optional: only keep these if you truly need them (you probably don't)
38
+ # RUN pip install --no-cache-dir textblob faker transformers
39
+
40
+ RUN python -m ipykernel install --user --name python3 --display-name "Python 3"
41
+
42
+ # R deps for notebook execution via papermill (IRkernel)
43
+ RUN R -e "options(repos=c(CRAN='https://cloud.r-project.org')); install.packages('IRkernel')"
44
+ RUN R -e "IRkernel::installspec(user = FALSE)"
45
+
46
  EXPOSE 7860
47
  CMD ["python", "app.py"]