igroffman commited on
Commit
4bccde6
·
verified ·
1 Parent(s): 33b3f9c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -10
Dockerfile CHANGED
@@ -1,5 +1,6 @@
1
  FROM rocker/r-base:latest
2
 
 
3
  RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
4
  libcurl4-openssl-dev \
5
  libssl-dev \
@@ -9,25 +10,31 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-ins
9
  libxrender1 \
10
  libxext6 \
11
  libnss3 \
12
- libasound2 \
 
 
 
 
 
 
13
  libatk-bridge2.0-0 \
14
  libgtk-3-0 \
15
  libdrm2 \
16
  libgbm1 \
17
  fonts-liberation \
 
18
  chromium \
19
  ca-certificates \
20
- && rm -rf /var/lib/apt/lists/*
21
 
22
- # Let chromote/webshot2 find Chromium
23
  ENV CHROME_BIN=/usr/bin/chromium
24
  ENV CHROMOTE_CHROME=/usr/bin/chromium
 
25
 
26
- # Create app dir
27
  WORKDIR /app
28
 
29
- # Install R packages (keep this separate so it layers/caches nicely)
30
- # Add anything else you need here
31
  RUN install2.r --error --skipinstalled \
32
  shiny \
33
  shinydashboard \
@@ -39,11 +46,10 @@ RUN install2.r --error --skipinstalled \
39
  htmlwidgets \
40
  ggplot2
41
 
42
-
43
  COPY . /app
44
 
45
  EXPOSE 7860
46
 
47
- # Run the Shiny app
48
- # This respects PORT if provided by the host, defaulting to 7860.
49
- 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/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 \
 
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 \
 
46
  htmlwidgets \
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')"]