-
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.
- Loading branch information
Showing
4 changed files
with
87 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.dockerignore | ||
Dockerfile | ||
.DS_Store |
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,51 @@ | ||
FROM rocker/shiny:3.6.1 | ||
LABEL maintainer="Jens Preussner <jens.preussner@mpi-bn.mpg.de>" | ||
LABEL maintainer="Hendrik Schultheis <hendrik.schultheis@mpi-bn.mpg.de>" | ||
LABEL maintainer="Carsten Kuenne <carsten.kuenne@mpi-bn.mpg.de>" | ||
LABEL version="2.1.0" | ||
|
||
# | ||
# Configuration | ||
# | ||
ENV \ | ||
# Define the default location from which the app is served | ||
WILSON_LOCATION=/ \ | ||
# Define the landing page for the app | ||
WILSON_LANDING_PAGE=introduction | ||
|
||
# | ||
# Move app and data to container | ||
# | ||
COPY . /srv/shiny-server | ||
|
||
# | ||
# Installation procedure | ||
# | ||
RUN apt-get update && apt-get install -y \ | ||
libnlopt-dev \ | ||
libssl-dev \ | ||
libxml2-dev \ | ||
libcurl4-openssl-dev \ | ||
git \ | ||
procps \ | ||
python-pip && \ | ||
apt-get clean && \ | ||
# Install jinja2 templating engine | ||
pip install j2cli && \ | ||
# Install R infrastructure | ||
R -e "install.packages(c('BiocManager', 'webshot'), repos = c(CRAN = 'https://cloud.r-project.org/'))" && \ | ||
R -e "webshot::install_phantomjs()" && \ | ||
R -e "BiocManager::install(c('shinyBS', 'shinydashboard', 'shinythemes', 'htmltools', 'wilson'))" && \ | ||
cp /root/bin/phantomjs /usr/local/bin && \ | ||
# Move entrypoint, create log directory | ||
mv /srv/shiny-server/entrypoint.sh / && \ | ||
mkdir /srv/shiny-server/logs && \ | ||
# Change ownerships | ||
chmod -R ugo+wrX /var/log/shiny-server/ && \ | ||
chown -R shiny:shiny /srv/shiny-server/ && \ | ||
# Clean up existing sample apps | ||
rm -rf /srv/shiny-server/[0-9][0-9]_* /srv/shiny-server/index.html /srv/shiny-server/sample-apps | ||
|
||
# Start container | ||
USER shiny | ||
ENTRYPOINT ["/entrypoint.sh", "/usr/bin/shiny-server.sh"] |
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,4 @@ | ||
#!/bin/bash -e | ||
j2 /srv/shiny-server/shiny-server.conf.j2 > /srv/shiny-server/shiny-server.conf | ||
|
||
exec "$@" |
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,29 @@ | ||
# Define the user we should use when spawning R Shiny processes | ||
run_as shiny; | ||
|
||
# Preserve logging, although the main process exits with status 0 | ||
preserve_logs true; | ||
|
||
# Enable detailed error messages for users | ||
sanitize_errors off; | ||
|
||
# Define a top-level server which will listen on a port | ||
server { | ||
# Instruct this server to listen on port 3838 | ||
listen 3838; | ||
|
||
# Define the location available at the base URL | ||
location {{ "WILSON_LOCATION"|env("/") }} { | ||
|
||
# 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; | ||
|
||
# Should we list the contents of a (non-Shiny-App) directory when the user | ||
# visits the corresponding URL? | ||
directory_index on; | ||
} | ||
} |