edgarodriguez commited on
Commit
e9745bf
·
verified ·
1 Parent(s): 581463c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -6
Dockerfile CHANGED
@@ -2,11 +2,12 @@
2
  # Base ships R + sf/GDAL/GEOS/PROJ (the slowest deps to build).
3
  FROM rocker/geospatial:4.4
4
 
5
- # DuckDB lives on the edgarodriguez/depth_alpha dataset; baked in at build.
6
- # Override with: docker build --build-arg DDB_URL=... -t depth-hf .
 
 
 
7
  ARG DDB_URL=https://huggingface.co/datasets/edgarodriguez/depth_alpha/resolve/main/depth_mexico.duckdb
8
- # For a PRIVATE dataset, also pass --build-arg HF_TOKEN=hf_xxx
9
- ARG HF_TOKEN=
10
 
11
  RUN install2.r --error --skipinstalled \
12
  shiny bslib DBI duckdb dplyr jsonlite htmltools glue writexl ggplot2 stringr \
@@ -17,8 +18,7 @@ WORKDIR /app
17
  COPY 10.11_draw_query_indicators_v10_HF.R helpers.R 10.08_styles.css ./
18
 
19
  # Bake the DuckDB into the image (build-time download).
20
- RUN if [ -n "$HF_TOKEN" ]; then AUTH="Authorization: Bearer $HF_TOKEN"; else AUTH=""; fi \
21
- && curl -fL ${AUTH:+-H "$AUTH"} "${DDB_URL}" -o /app/depth_mexico.duckdb \
22
  && test -s /app/depth_mexico.duckdb \
23
  && ls -lh /app/depth_mexico.duckdb
24
 
@@ -30,3 +30,4 @@ ENV DEPTH_DDB_PATH=/app/depth_mexico.duckdb \
30
 
31
  EXPOSE 7860
32
  CMD ["Rscript", "10.11_draw_query_indicators_v10_HF.R"]
 
 
2
  # Base ships R + sf/GDAL/GEOS/PROJ (the slowest deps to build).
3
  FROM rocker/geospatial:4.4
4
 
5
+ # DuckDB lives on the edgarodriguez/depth_alpha dataset (public); baked in at
6
+ # build. Override with: docker build --build-arg DDB_URL=... -t depth-hf .
7
+ # If the dataset is ever made PRIVATE, add a build secret instead of an ARG:
8
+ # RUN --mount=type=secret,id=hf_token curl -H "Authorization: Bearer \
9
+ # $(cat /run/secrets/hf_token)" -fL "${DDB_URL}" -o /app/depth_mexico.duckdb
10
  ARG DDB_URL=https://huggingface.co/datasets/edgarodriguez/depth_alpha/resolve/main/depth_mexico.duckdb
 
 
11
 
12
  RUN install2.r --error --skipinstalled \
13
  shiny bslib DBI duckdb dplyr jsonlite htmltools glue writexl ggplot2 stringr \
 
18
  COPY 10.11_draw_query_indicators_v10_HF.R helpers.R 10.08_styles.css ./
19
 
20
  # Bake the DuckDB into the image (build-time download).
21
+ RUN curl -fL "${DDB_URL}" -o /app/depth_mexico.duckdb \
 
22
  && test -s /app/depth_mexico.duckdb \
23
  && ls -lh /app/depth_mexico.duckdb
24
 
 
30
 
31
  EXPOSE 7860
32
  CMD ["Rscript", "10.11_draw_query_indicators_v10_HF.R"]
33
+