我有一个与ldap身份验证工作的shinyproxy应用程序。但是,为了从SQL数据库中检索数据,我现在使用(不推荐)R代码中的硬编码连接字符串和这里提到的凭据(我使用服务用户,因为我的最终用户没有权限查询数据库):
con <- DBI::dbConnect(odbc::odbc(), encoding = "latin1", .connection_string = 'Driver={Driver};Server=Server;Database=dbb;UID=UID;PWD=PWD') 我尝试用一个环境变量替换连接字符串,这个环境变量是我从linux主机传递到容器的。当在ShinyProxy外部运行容器时,这是有效的,因此通过在运行时使用以下docker命令传递环境变量:
docker run -it --env-file env.list app123但是,在使用ShinyProxy时,我不清楚如何在yaml配置文件中配置它。如何在此级别传递语句--env- env.list文件,以便在链接容器中拾取它?
如有任何帮助,敬请惠顾!
发布于 2020-10-27 05:36:24
来自这个已结束的问题:https://github.com/openanalytics/shinyproxy/issues/99
您的application.yaml可能如下所示:
proxy:
title: Open Analytics Shiny Proxy
logo-url: http://www.openanalytics.eu/sites/www.openanalytics.eu/themes/oa/logo.png
landing-page: /
heartbeat-rate: 10000
heartbeat-timeout: 60000
port: 8080
authentication: simple
admin-groups: admin
# Example: 'simple' authentication configuration
users:
- name: admin
password: password
groups: admin
# Docker configuration
docker:
internal-networking: true
specs:
- id: 01_hello
display-name: Hello Application
description: Application which demonstrates the basics of a Shiny app
container-cmd: ["R", "-e", "shinyproxy::run_01_hello()"]
container-image: openanalytics/shinyproxy-demo
container-env-file: /app/shinyproxy/test.env
container-env:
bar: baz
access-groups: admin
container-network: shinyproxy_reprex_default
logging:
file:
shinyproxy.log具体来说,您似乎可以使用container-env-file在文件中设置环境变量。
https://stackoverflow.com/questions/64542667
复制相似问题