Skip to content

Commit

Permalink
feat: generate a shiny config for running in renkulab
Browse files Browse the repository at this point in the history
  • Loading branch information
ciyer committed Jan 9, 2025
1 parent 2167dd3 commit d86c689
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
9 changes: 8 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ ENV NB_GID=997
COPY fix-permissions.sh /usr/local/bin
RUN fix-permissions.sh /usr/local/lib/R

COPY shiny-server.conf /etc/shiny-server/shiny-server.conf
RUN apt-get update && apt-get install -y \
gettext-base

COPY shiny-server.conf.tpl /shiny-server.conf.tpl
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chown shiny:shiny /etc/shiny-server/shiny-server.conf

USER shiny
ENTRYPOINT ["/bin/sh", "/docker-entrypoint.sh"]
CMD ["/init"]
24 changes: 24 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
#
# Copyright 2025 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

envsubst < /shiny-server.conf.tpl > /etc/shiny-server/shiny-server.conf

echo "Using shiny-server.conf:"
cat /etc/shiny-server/shiny-server.conf

exec "$@"
4 changes: 2 additions & 2 deletions shiny-server.conf → shiny-server.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ run_as shiny;
server {
listen 3838;
# Define a location at the base URL
location / {
# Renku will pass in the base URL path to the container
location /$RENKU_BASE_URL_PATH/ {
# Host the directory of Shiny Apps stored in this directory
site_dir /srv/shiny-server;
Expand Down

0 comments on commit d86c689

Please sign in to comment.