Skip to content

Instantly share code, notes, and snippets.

@yaroslavTsebro
Last active July 26, 2023 12:52
Show Gist options
  • Select an option

  • Save yaroslavTsebro/6f3bacd732c8fc23168455fe19c51667 to your computer and use it in GitHub Desktop.

Select an option

Save yaroslavTsebro/6f3bacd732c8fc23168455fe19c51667 to your computer and use it in GitHub Desktop.
mongo-express | Welcome to mongo-express
mongo-express | ------------------------
mongo-express |
mongo-express |
mongo-express |
mongo-express | (node:7) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
mongo-express | Could not connect to database using connectionString: mongodb://root:example@mongodb:27017/"
mongo-express | (node:7) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [mongodb:27017] on first connect [Error: connect ECONNREFUSED 172.19.0.2:27017
mongo-express | at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16) {
mongo-express | name: 'MongoNetworkError'
mongo-express | }]
mongo-express | at Pool.<anonymous> (/node_modules/mongodb/lib/core/topologies/server.js:441:11)
mongo-express | at Pool.emit (events.js:314:20)
mongo-express | at /node_modules/mongodb/lib/core/connection/pool.js:564:14
mongo-express | at /node_modules/mongodb/lib/core/connection/pool.js:1000:11
mongo-express | at /node_modules/mongodb/lib/core/connection/connect.js:32:7
mongo-express | at callback (/node_modules/mongodb/lib/core/connection/connect.js:300:5)
mongo-express | at Socket.<anonymous> (/node_modules/mongodb/lib/core/connection/connect.js:330:7)
mongo-express | at Object.onceWrapper (events.js:421:26)
mongo-express | at Socket.emit (events.js:314:20)
mongo-express | at emitErrorNT (internal/streams/destroy.js:92:8)
mongo-express | at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
mongo-express | at processTicksAndRejections (internal/process/task_queues.js:84:21)
mongo-express | (node:7) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
mongo-express | (node:7) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
mongo-express exited with code 0
version: "3.9"
services:
mongodb:
image: mongo:7.0.0-rc7
ports:
- "27017:27017"
container_name: "mongodb"
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
MONGO_INITDB_DATABASE: mydatabase
volumes:
- /backend/data/initdb.sh:/docker-entrypoint-initdb.d/mongo-init.sh:ro
- /backend/data/db:/data/db
- /backend/data/logs/db:/var/log/mongodb
mongo-express:
image: mongo-express:1.0.0-alpha.4
restart: always
ports:
- 8081:8081
depends_on:
- mongodb
container_name: "mongo-express"
environment:
ME_CONFIG_MONGODB_SERVER: mongodb
ME_CONFIG_MONGODB_ENABLE_ADMIN: true
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example
ME_CONFIG_BASICAUTH_USERNAME: root
ME_CONFIG_BASICAUTH_PASSWORD: example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment