sugitora commited on
Commit
44dd364
·
verified ·
1 Parent(s): 08a1557

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -29
Dockerfile CHANGED
@@ -1,10 +1,10 @@
1
  # Dockerfile for Hugging Face Spaces - R Shiny App
2
- # Risk Monitoring Dashboard
3
 
4
- FROM rocker/shiny:4.3.2
5
 
6
  # Install system dependencies
7
- RUN apt-get update && apt-get install -y \
8
  libcurl4-gnutls-dev \
9
  libssl-dev \
10
  libxml2-dev \
@@ -15,46 +15,29 @@ RUN apt-get update && apt-get install -y \
15
  libjpeg-dev \
16
  libharfbuzz-dev \
17
  libfribidi-dev \
18
- libgdal-dev \
19
- libgeos-dev \
20
- libproj-dev \
21
- libudunits2-dev \
22
  pandoc \
23
  && rm -rf /var/lib/apt/lists/*
24
 
25
  # Install R packages
26
  RUN R -e "install.packages(c(\
27
  'shiny', \
28
- 'bslib', \
29
- 'leaflet', \
 
 
30
  'plotly', \
31
  'DT', \
32
- 'dplyr', \
33
- 'lubridate' \
34
  ), repos='https://cloud.r-project.org/')"
35
 
36
  # Create app directory
37
- RUN mkdir -p /srv/shiny-server/app
38
 
39
  # Copy app files
40
- COPY app.R /srv/shiny-server/app/
41
-
42
- # Set permissions
43
- RUN chown -R shiny:shiny /srv/shiny-server/app
44
 
45
  # Expose port (Hugging Face uses 7860)
46
  EXPOSE 7860
47
 
48
- # Configure shiny-server to use port 7860
49
- RUN echo "run_as shiny;\n\
50
- server {\n\
51
- listen 7860;\n\
52
- location / {\n\
53
- site_dir /srv/shiny-server/app;\n\
54
- log_dir /var/log/shiny-server;\n\
55
- directory_index on;\n\
56
- }\n\
57
- }" > /etc/shiny-server/shiny-server.conf
58
-
59
- # Start shiny-server
60
- CMD ["/usr/bin/shiny-server"]
 
1
  # Dockerfile for Hugging Face Spaces - R Shiny App
2
+ # Quality Growth Strategy Dashboard
3
 
4
+ FROM rocker/r-ver:4.3.2
5
 
6
  # Install system dependencies
7
+ RUN apt-get update && apt-get install -y --no-install-recommends \
8
  libcurl4-gnutls-dev \
9
  libssl-dev \
10
  libxml2-dev \
 
15
  libjpeg-dev \
16
  libharfbuzz-dev \
17
  libfribidi-dev \
 
 
 
 
18
  pandoc \
19
  && rm -rf /var/lib/apt/lists/*
20
 
21
  # Install R packages
22
  RUN R -e "install.packages(c(\
23
  'shiny', \
24
+ 'shinydashboard', \
25
+ 'ggplot2', \
26
+ 'dplyr', \
27
+ 'tidyr', \
28
  'plotly', \
29
  'DT', \
30
+ 'scales' \
 
31
  ), repos='https://cloud.r-project.org/')"
32
 
33
  # Create app directory
34
+ WORKDIR /app
35
 
36
  # Copy app files
37
+ COPY app.R /app/
 
 
 
38
 
39
  # Expose port (Hugging Face uses 7860)
40
  EXPOSE 7860
41
 
42
+ # Run Shiny app directly
43
+ CMD ["R", "-e", "shiny::runApp('/app', host='0.0.0.0', port=7860)"]