Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'container-env-file' not working #99

Closed
rstub opened this issue Oct 1, 2018 · 3 comments
Closed

'container-env-file' not working #99

rstub opened this issue Oct 1, 2018 · 3 comments
Labels

Comments

@rstub
Copy link

rstub commented Oct 1, 2018

Here the example mentioned in https://support.openanalytics.eu/t/container-env-file-not-working/756 for container-enf-file not working. This needs multiple files in one directory:

docker-compose.yml:

version: "3.1"

services:

  shinyproxy:
    build: .
    image: shinyproxy_reprex
    ports:
      - 9000:8080
    volumes:
      - ./application.yml:/app/shinyproxy/application.yml
      - ./test.env:/app/shinyproxy/test.env
      - /var/run/docker.sock:/var/run/docker.sock

Dockerfile:

FROM openjdk:11-jre

WORKDIR /app/shinyproxy

RUN \
  wget -q https://www.shinyproxy.io/downloads/shinyproxy-2.0.4.jar \
    -O /app/shinyproxy/shinyproxy.jar
  
EXPOSE 8080

CMD ["java", "-jar", "shinyproxy.jar"]

application.yml:

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

test.env:

foo=bar

With this set-up one can call

$ docker-compose up --build -d

to start shinyproxy, login ht http://localhost:9000/ with admin:password and start the available app. Inspecting the environment variables for the app I get:

$ docker exec <container_name> env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=279de996de99
SHINYPROXY_USERNAME=admin
SHINYPROXY_USERGROUPS=ADMIN
bar=baz
LC_ALL=en_US.UTF-8
LANG=en_US.UTF-8
R_BASE_VERSION=3.4.4
HOME=/root

Note that bar=baz which has been set via container-envis present, whilefoo=barwhich should have come viacontainer-env-file` is missing.

@fmichielssen
Copy link
Member

Hi @rstub,

Thanks for bringing this up. A fix has been committed: openanalytics/containerproxy@9d665c8
and will be in the next release.

@rstub
Copy link
Author

rstub commented Oct 11, 2018

Thanks for the fix.

@tverbeke
Copy link
Member

Released as part of ShinyProxy 2.0.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants