我们让golem包自动为我们创建一个 Dockerfile 并且可以运行 docker 镜像并在根目录看到应用程序:http://localhost:3838/?...
但是我们希望应用程序出现在子目录中http://localhost:3838/myApp/v1/?...,这样我们就可以为 Apache 设置必要的代理,并让这个应用程序和其他应用程序都可以从单个服务器上使用。
我们可以手动编辑 Dockerfile 以复制包含以下信息的 shiny-server.conf 文件:
# Define a server that listens on port 3838
server {
  listen 3838;
  # Define a location at the base URL
  location /myApp/v1/ {
    # Host the directory of Shiny Apps stored in this directory
    site_dir /srv/shiny-server;
    # Log all Shiny output to files in this directory
    log_dir /var/log/shiny-server;
  }
}
上面的解决方案感觉像是一个 hack,我们希望golem内部有一些功能可以让我们设置应用程序出现的子目录。