aaronshaf/dynamodb-admin

Docker image not working when using an external .env variable

Closed this issue · 2 comments

jcjp commented

I tried the docker image using docker-compose to build and run the image.

Its working when directly adding the environments on the docker-compose file:

  ddb_local_ad:
    container_name: ddb_local_ad
    restart: always
    depends_on:
      - <local_dynamo>
    image: aaronshaf/dynamodb-admin
    ports:
      - <PORT>:<PORT>
    # Includes DYNAMO_ENDPOINT: <local_dynamo>:<local_dynamo_PORT>
    env_file:
      - ./.env
    # Using environment below works properly
    # environment:
    #   DYNAMO_ENDPOINT: <local_dynamo>:<local_dynamo_PORT>

Is adding the environment only way to run the docker image?

rchl commented

I have not used this feature but this should be unrelated to dynamodb-admin itself. I would think that it's a feature of docker-compose and both env_file and environment should be equivalent in functionality from the perspective of the container.

jcjp commented

I have not used this feature but this should be unrelated to dynamodb-admin itself. I would think that it's a feature of docker-compose and both env_file and environment should be equivalent in functionality from the perspective of the container.

Correct on all points, what weird is that I cannot open the dynamodb-admin if I pass in an external .env file while I use the same .env file for other container as well and they are working properly. My guess it that is hould work automatically since using environment works but if I use env_file and an external .env with DYNAMO_ENDPOINT it doesn't work.

EDIT: Okay looks like an env variable (PORT) is affecting the dynamodb-admin itself, this is resolved. Thanks for the help @rchl