forked from MIKEINTOSHSYSTEMS/DHIS2HEAT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.shiny
More file actions
76 lines (58 loc) · 3.2 KB
/
Dockerfile.shiny
File metadata and controls
76 lines (58 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM rocker/shiny:latest
# Install necessary system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
systemctl \
nano \
htop \
lsof \
inotify-tools \
libssl-dev \
libxml2-dev \
libsodium23 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install CRAN packages and GitHub packages in a single step to reduce layers
#RUN R -e "install.packages(c('remotes', 'shiny', 'shinyjs', 'shinyWidgets', 'shinycssloaders', 'DT', 'httr', 'jsonlite', 'openxlsx', 'plotly', 'bslib', 'arrow', 'colourpicker', 'shinydashboard', 'shinyalert', 'dplyr', 'scales', 'pastecs', 'car', 'ggfortify', 'psych', 'sqldf', 'lubridate', 'kableExtra', 'gridExtra', 'fastDummies', 'DataExplorer', 'tidyverse', 'colorspace'), dependencies = TRUE, repos = 'https://cran.r-project.org/'); \
# remotes::install_github(c('rstudio/gridlayout', 'tidyverse/ggplot2', 'thomasp85/patchwork'))"
# Basic Install for Testing
RUN R -e "install.packages(c('remotes', 'httr'), dependencies = TRUE, repos = 'https://cran.r-project.org/')"
# Install Remote GitHub packages
RUN R -e "remotes::install_github(c('rstudio/gridlayout', 'tidyverse/ggplot2', 'thomasp85/patchwork'))"
# Copy Shiny app files to the container
COPY . /srv/shiny-server/
COPY shiny-server.conf /etc/shiny-server/shiny-server.conf
#COPY /etc/letsencrypt/live/heat.merqconsultancy.org/privkey.pem /etc/shiny-server/privkey.pem
#COPY /etc/letsencrypt/live/heat.merqconsultancy.org/fullchain.pem /etc/shiny-server/fullchain.pem
# Ensure correct permissions
RUN chown -R shiny:shiny /srv/shiny-server && chmod +x /srv/shiny-server/start_shiny_app.sh
RUN chown -R shiny:shiny /srv/shiny-server && chmod +x /srv/shiny-server/deploy_shiny_app.sh
RUN chown -R shiny:shiny /srv/shiny-server && chmod +x /srv/shiny-server/monitor_shiny_app.sh
RUN chown -R shiny:shiny /srv/shiny-server && chmod +x /srv/shiny-server/install_shiny_packages.sh
# Ensure start_shiny_app.sh and other scripts are executable
RUN chmod +x /srv/shiny-server/start_shiny_app.sh
#RUN chmod +x start_shiny_app.sh
RUN chmod +x /srv/shiny-server/deploy_shiny_app.sh
#RUN chmod +x deploy_shiny_app.sh
RUN chmod +x /srv/shiny-server/init.deploy.sh
#RUN chmod +x init.deploy.sh
RUN chmod +x /srv/shiny-server/install_shiny_packages.sh
#RUN chmod +x install_shiny_packages.sh
# Set working directory for the Shiny app
WORKDIR /srv/shiny-server
# Expose ports (3838 for the Shiny app, 3939 for the Shiny Server admin)
#EXPOSE 3838 3939 80
#EXPOSE 3939 80 443
EXPOSE 3939 80 443
# Start Shiny Server
#CMD ["./start_shiny_app.sh"]
#CMD ["./deploy_shiny_app.sh"]
#CMD ["./init.deploy.sh"]
# Start Shiny Server with chained commands
#CMD ["sh", "-c", "./deploy_shiny_app.sh && ./init.deploy.sh && ./install_shiny_packages.sh && ./start_shiny_app.sh"]
# Fast Deploy and Start with chained commands
#CMD ["sh", "-c", "./init.deploy.sh && ./install_shiny_packages.sh && ./start_shiny_app.sh"]
#CMD ["sh", "-c", "./install_shiny_packages.sh && ./init.deploy.sh && ./start_shiny_app.sh"]
# Start the Shiny app
#CMD ["R", "-e", "shiny::runApp('/srv/shiny-server/app')"]
#CMD ["sh", "-c", "init.deploy.sh"]
#CMD ["sh", "-c", "./install_shiny_packages.sh"]
#CMD ["sh", "-c", "./srv/shiny-server/install_shiny_packages.sh"]