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

Docker using .env? #51

Closed
jacksonp2008 opened this issue Sep 6, 2017 · 2 comments
Closed

Docker using .env? #51

jacksonp2008 opened this issue Sep 6, 2017 · 2 comments

Comments

@jacksonp2008
Copy link

I am converting to the docker image hosting on AWS. I put the .env file in the same directory with docker-compose.yml etc. it contains LDAP settings but I do not see any packets going to my LDAP server. It appears that it may not be reading .env, do I have this in the wrong location?

thanks!

@ssddanbrown
Copy link
Contributor

@jacksonp2008

When using docker-compose, variables in a .env will not be passed through to the container, They are only usable within the docker-compose itself.

You should be able to use the env_file option to pass them through to the container like so:

version: '2'
services:

  mysql:
    image: mysql:5.7.12
    environment:
    - MYSQL_ROOT_PASSWORD=secret
    - MYSQL_DATABASE=bookstack
    - MYSQL_USER=bookstack
    - MYSQL_PASSWORD=secret
    volumes:
    - mysql-data:/var/lib/mysql

  bookstack:
    image: solidnerd/bookstack:0.17.1
    depends_on:
    - mysql
    env_file: .env
    volumes:
    - uploads:/var/www/BookStack/public/uploads
    - storage-uploads:/var/www/BookStack/storage/uploads
    ports:
    - "8080:80"

@jacksonp2008
Copy link
Author

very good. This works.

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

No branches or pull requests

2 participants