VeenaLim commited on
Commit
dc2779b
·
verified ·
1 Parent(s): 7a71ffc

Remove model file from local repo to let it try sharepoint directly line 32

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -38
Dockerfile CHANGED
@@ -1,38 +1,38 @@
1
- # Use rocker/r-ver as base image with R pre-installed
2
- FROM rocker/r-ver:4.3.2
3
-
4
- # Install system dependencies required for R packages
5
- RUN apt-get update && apt-get install -y --no-install-recommends \
6
- libcurl4-openssl-dev \
7
- libssl-dev \
8
- libxml2-dev \
9
- libsodium-dev \
10
- libgit2-dev \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- # Install R packages with explicit error checking
14
- RUN R -e "install.packages('plumber', repos='https://cloud.r-project.org/')" && \
15
- R -e "if (!require('plumber')) quit(status=1)"
16
-
17
- RUN R -e "install.packages(c('readr', 'assertthat', 'jsonlite', 'remotes'), repos='https://cloud.r-project.org/')"
18
-
19
- # Install dampack from GitHub
20
- RUN R -e "remotes::install_github('DARTH-git/dampack', upgrade='never')" && \
21
- R -e "if (!require('dampack')) quit(status=1)"
22
-
23
- # Verify all packages are installed
24
- RUN R -e "stopifnot(require('plumber'), require('readr'), require('assertthat'), require('jsonlite'), require('dampack'))"
25
-
26
- # Create app directory structure
27
- WORKDIR /app
28
- RUN mkdir -p /app/api /app/model
29
-
30
- # Copy API and model files (CSV is now sent by client, not embedded)
31
- COPY plumber_hf.R /app/api/plumber.R
32
- COPY darth_funcs.R /app/model/darth_funcs.R
33
-
34
- # Expose port 7860 (Hugging Face Spaces default)
35
- EXPOSE 7860
36
-
37
- # Run the Plumber API
38
- CMD ["R", "-e", "library(plumber); pr <- plumb('/app/api/plumber.R'); pr$run(host='0.0.0.0', port=7860)"]
 
1
+ # Use rocker/r-ver as base image with R pre-installed
2
+ FROM rocker/r-ver:4.3.2
3
+
4
+ # Install system dependencies required for R packages
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ libcurl4-openssl-dev \
7
+ libssl-dev \
8
+ libxml2-dev \
9
+ libsodium-dev \
10
+ libgit2-dev \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Install R packages with explicit error checking
14
+ RUN R -e "install.packages('plumber', repos='https://cloud.r-project.org/')" && \
15
+ R -e "if (!require('plumber')) quit(status=1)"
16
+
17
+ RUN R -e "install.packages(c('readr', 'assertthat', 'jsonlite', 'remotes'), repos='https://cloud.r-project.org/')"
18
+
19
+ # Install dampack from GitHub
20
+ RUN R -e "remotes::install_github('DARTH-git/dampack', upgrade='never')" && \
21
+ R -e "if (!require('dampack')) quit(status=1)"
22
+
23
+ # Verify all packages are installed
24
+ RUN R -e "stopifnot(require('plumber'), require('readr'), require('assertthat'), require('jsonlite'), require('dampack'))"
25
+
26
+ # Create app directory structure
27
+ WORKDIR /app
28
+ RUN mkdir -p /app/api /app/model
29
+
30
+ # Copy API and model files (CSV is now sent by client, not embedded)
31
+ COPY plumber_hf.R /app/api/plumber.R
32
+ # COPY darth_funcs.R /app/model/darth_funcs.R
33
+
34
+ # Expose port 7860 (Hugging Face Spaces default)
35
+ EXPOSE 7860
36
+
37
+ # Run the Plumber API
38
+ CMD ["R", "-e", "library(plumber); pr <- plumb('/app/api/plumber.R'); pr$run(host='0.0.0.0', port=7860)"]