Skip to content
New issue

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

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

Already on GitHub? # to your account

Custom entrypoint - loosing environment variables #35

Open
tamis-laan opened this issue Oct 25, 2021 · 0 comments
Open

Custom entrypoint - loosing environment variables #35

tamis-laan opened this issue Oct 25, 2021 · 0 comments

Comments

@tamis-laan
Copy link

I'm trying to create a custom docker compose where I'm going to execute custom commands before starting mongod. However if I add the entry point the environment variables are no longer picked up! Not sure why this is happening?

 mongo:
    image: mongo:4.4
    volumes:
      - ./data/mongo:/data/db
    environment:
      MONGO_INITDB_DATABASE: ${MONGO_DATABASE}
      MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
      MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
    restart: unless-stopped
    entrypoint: >
      /bin/sh -c "
      mongod
      "
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant