forked from eDrivers/eDriversApp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Ecosystem-Assessments/CST-241-deploy-app
CST-241-deploy-app
- Loading branch information
Showing
44 changed files
with
99 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,37 @@ | ||
# Base R Shiny image | ||
FROM rocker/geospatial:latest | ||
FROM rocker/shiny:4.3.0 | ||
|
||
RUN apt-get update && apt-get install -y | ||
|
||
# Copy the Shiny app code | ||
WORKDIR /home/app | ||
ADD . /home/app | ||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
libproj-dev \ | ||
libudunits2-dev \ | ||
libgdal-dev \ | ||
libgeos-dev \ | ||
libsqlite0-dev | ||
|
||
# Install R dependencies | ||
RUN install2.r remotes | ||
RUN Rscript -e 'remotes::install_deps()' | ||
RUN Rscript -e 'remotes::install_version("raster", upgrade = "never", version = "3.6-14")' | ||
RUN Rscript -e 'remotes::install_version("leaflet", upgrade = "never", version = "2.1.1")' | ||
RUN Rscript -e 'remotes::install_version("shiny", upgrade = "never", version = "1.7.0")' | ||
RUN Rscript -e 'remotes::install_version("shinyjs", upgrade = "never", version = "2.0.0")' | ||
RUN Rscript -e 'remotes::install_version("magrittr", upgrade = "never", version = "2.0.3")' | ||
RUN Rscript -e 'remotes::install_version("sf", upgrade = "never", version = "1.0-9")' | ||
RUN Rscript -e 'remotes::install_version("dplyr", upgrade = "never", version = "1.0.4")' | ||
RUN Rscript -e 'remotes::install_version("tidyr", upgrade = "never", version = "1.2.1")' | ||
|
||
# Copy shiny app into the Docker image | ||
COPY app /srv/shiny-server/ | ||
|
||
# Copy configuration files into the Docker image | ||
COPY shiny-server.conf /etc/shiny-server/shiny-server.conf | ||
|
||
# Copy shiny app execution file into the Docker image | ||
COPY shiny-server.sh /usr/bin/shiny-server.sh | ||
|
||
# Expose the application port | ||
EXPOSE 8083 | ||
EXPOSE 5000 | ||
|
||
USER shiny | ||
|
||
# Run the R Shiny app | ||
CMD Rscript -e "shiny::runApp(port = 8083, host = '0.0.0.0')" | ||
CMD ["/usr/bin/shiny-server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Instruct Shiny Server to run applications as the user "shiny" | ||
run_as shiny; | ||
|
||
# Define a server that listens on port 3838 | ||
server { | ||
listen 5000; | ||
|
||
# Define a location at the base URL | ||
location / { | ||
|
||
# Run this location in 'site_dir' mode, which hosts the entire directory | ||
# tree at '/srv/shiny-server' | ||
site_dir /srv/shiny-server; | ||
|
||
# Define where we should put the log files for this location | ||
log_dir /var/log/shiny-server; | ||
|
||
# When a user visits the base URL rather than a particular application, | ||
# an index of the applications available in this directory will be shown. | ||
directory_index off; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
Rscript -e "shiny::runApp(port = 5000, host = '0.0.0.0')" 2>&1 |