Closed chgad closed 7 months ago
This has to do with docker networking. 127.0.0.1 in a container points at that container, not at the host. You'll need to either connect them both to the same network, route to the public server ip, or somehow reference the docker internal host name as shown here: https://stackoverflow.com/a/70725882
Description of problem
I'm trying to setup an Instance of Mongo-express via docker-compose to manage a MongoDB created by dokku-mongo.
I have the following docker-compose.yml file, basically just defining the Envvariables:
The
dokku mongo:info
of themy_mongo_staging_db
is as follows:As you can see i already exposed the dokku-mongo service to 127.0.0.1:27017.
However, when i try to start the Mongo Express app via
docker-compose up
I encouter:Did I do the Expose incorrectly or mix up the database credentials?
How reproducible
Use docker-compose.yml above. Create dokku-mongo service as usual. Expose Port 127.0.0.1:27017. Start App
Steps to Reproduce
1. 2. 3.
Actual Results
Mongo-Express App does not connect to dokku-mongo db.
Expected Results
Connection successfull and startup of Mongo-Express app.
Environment Information
dokku report APP_NAME
outputIt's a dokku-mongo service. Issueing this command yields in a
! App time_vault_staging_db does not exist
message.