igroffman commited on
Commit
268801b
·
verified ·
1 Parent(s): 4bccde6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -26
Dockerfile CHANGED
@@ -1,40 +1,27 @@
1
- FROM rocker/r-base:latest
2
 
3
- # System deps for R pkgs + headless Chromium (for webshot2 PNG export)
 
 
4
  RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
5
- libcurl4-openssl-dev \
6
- libssl-dev \
7
- libxml2-dev \
8
- libfontconfig1-dev \
9
- libfreetype6-dev \
10
- libxrender1 \
11
- libxext6 \
12
  libnss3 \
13
- libglib2.0-0 \
14
  libx11-6 \
15
- libx11-xcb1 \
16
- libxcb1 \
17
- libxcomposite1 \
18
- libxdamage1 \
19
- libxfixes3 \
20
- libatk-bridge2.0-0 \
21
  libgtk-3-0 \
22
- libdrm2 \
23
- libgbm1 \
24
  fonts-liberation \
25
  fonts-dejavu \
26
- chromium \
27
  ca-certificates \
28
  && rm -rf /var/lib/apt/lists/*
29
 
30
- # Let chromote/webshot2 find Chromium and use safe flags in containers
31
  ENV CHROME_BIN=/usr/bin/chromium
32
  ENV CHROMOTE_CHROME=/usr/bin/chromium
33
  ENV CHROMOTE_CHROME_ARGS="--no-sandbox --disable-dev-shm-usage"
34
 
35
- WORKDIR /app
36
-
37
- # R packages
38
  RUN install2.r --error --skipinstalled \
39
  shiny \
40
  shinydashboard \
@@ -47,9 +34,10 @@ RUN install2.r --error --skipinstalled \
47
  ggplot2
48
 
49
  # App code
50
- COPY . /app
51
 
 
52
  EXPOSE 7860
53
 
54
- # Run the Shiny app (uses $PORT if provided)
55
- CMD ["R", "--quiet", "-e", "options(shiny.port=as.integer(Sys.getenv('PORT', 7860)), shiny.host='0.0.0.0'); shiny::runApp('/app')"]
 
1
+ FROM rocker/shiny:latest
2
 
3
+ WORKDIR /code
4
+
5
+ # Minimal system deps for headless Chromium (webshot2) + TLS
6
  RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
7
+ chromium \
 
 
 
 
 
 
8
  libnss3 \
9
+ libgbm1 \
10
  libx11-6 \
11
+ libxrender1 \
12
+ libxext6 \
 
 
 
 
13
  libgtk-3-0 \
 
 
14
  fonts-liberation \
15
  fonts-dejavu \
 
16
  ca-certificates \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
+ # Let webshot2/chromote find Chromium and use safe flags in containers
20
  ENV CHROME_BIN=/usr/bin/chromium
21
  ENV CHROMOTE_CHROME=/usr/bin/chromium
22
  ENV CHROMOTE_CHROME_ARGS="--no-sandbox --disable-dev-shm-usage"
23
 
24
+ # R packages used by this app
 
 
25
  RUN install2.r --error --skipinstalled \
26
  shiny \
27
  shinydashboard \
 
34
  ggplot2
35
 
36
  # App code
37
+ COPY . /code
38
 
39
+ # Serve on 7860 to match your runApp call
40
  EXPOSE 7860
41
 
42
+ # Run app (respects $PORT if set by the platform)
43
+ CMD ["R", "--quiet", "-e", "options(shiny.port=as.integer(Sys.getenv('PORT', 7860)), shiny.host='0.0.0.0'); shiny::runApp('/code')"]