Skip to content

Custom entrypoint - loosing environment variables #35

@tamis-laan

Description

@tamis-laan

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
      "

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions