Docker-compose https://docs.docker.com/compose/
mongo - image https://hub.docker.com/_/mongo
keycloak https://hub.docker.com/r/jboss/keycloak/
Initializing a fresh instance When a container is started for the first time it will execute files with extensions .sh and .js that are found in /docker-entrypoint-initdb.d. Files will be executed in alphabetical order. .js files will be executed by mongo using the database specified by the MONGO_INITDB_DATABASE variable, if it is present, or test otherwise. You may also switch databases within the .js script.
nodejs - docker image https://hub.docker.com/_/node/
As we can see, the command defined in in the docker-compose.yml file overrides the one defined in the Dockerfile. // Command instruction in the Dockerfile CMD [“node”, “server.js”] // Command instruction in the docker-compose.yml file command: nodemon server.js
docker stop my_container
not authorized on admin to execute command { listDatabases: 1.0 }
http://localhost:8480/auth/admin
docker exec -it bookmarks.dev-mongo /bin/bash
mongo -u bookmarks -p secret --authenticationDatabase dev-bookmarks
use dev-bookmarks;
db.changeUserPassword("bookmarks", "secret")
docker exec bookmarks-api_mongo bash -c 'echo "$MONGO_INITDB_DATABASE"'
docker exec bookmarks-api_node bash -c 'echo "$MONGODB_BOOKMARKS_USERNAME"'
docker exec -it bookmarks-api_node /bin/bash
docker exec -it bookmarks-api_keycloak /bin/bash
docker volume ls | grep mongo
docker volume ls | grep postgres
docker volume rm bookmarks-api_mongo_data
docker volume rm bookmarks-api_postgres_data