ShinyProxy服务器部署同镜像第二个应用失败排查求助
Hey there, let's break down why your ShinyProxy container is failing to start after adding the second app, and how to fix it.
The Root Cause
The main issue is incorrect YAML configuration structure. ShinyProxy requires all application definitions to be wrapped in an apps array (a list in YAML terms). From your description, it looks like you just appended the second app's config directly at the top level of the file—this creates duplicate top-level keys (like name, id, port) that the YAML parser can't interpret correctly, causing the container to crash on startup.
While setting port: 80 for both apps isn't a direct problem (each container runs in its own network namespace, so internal ports don't conflict), the structural error is the critical blocker here.
The Fix
Wrap both application configurations inside an apps array, ensuring proper YAML indentation and syntax. Here's your corrected application.yml:
# Keep any existing top-level config (like server settings) here apps: - name: user1 password: password groups: app1 id: webapp1 display-name: application 1 description: web application 1 container-cmd: ["/usr/bin/shiny-server.sh"] container-image: mydockerimage container-volumes: ["/data/data1:/srv/shiny-server/data"] container-network: sp-example-net port: 80 access-groups: [admins, app1] - name: user2 password: password groups: app2 id: webapp2 display-name: application 2 description: web application 2 container-cmd: ["/usr/bin/shiny-server.sh"] container-image: mydockerimage container-volumes: ["/data/data2:/srv/shiny-server/data"] container-network: sp-example-net port: 80 access-groups: [admins, app2]
Key Notes
- Each app entry starts with
-to mark it as an item in theappsarray, and all its keys are indented under this line. - YAML is strict about whitespace—make sure indentation is consistent (usually 2 spaces per level).
- If you had other top-level configuration (like
serverorloggingsettings) in your original file, keep those outside theappsarray.
After updating the config file, restart your ShinyProxy container. It should now start successfully, and each app will load its respective dataset from the mounted volume while restricting access to the specified user groups.
内容的提问来源于stack exchange,提问作者zesla

