Docker Composeでmongodbをテストする

メモ的な記事です。
全然動くyamlが乗ってなかったので、書きました。

```yml:docker-compose.yml
version: '3'

services:

  mongo:
    image: mongo
    environment:
      MONGO_INITDB_ROOT_USERNAME: root
      MONGO_INITDB_ROOT_PASSWORD: MongoDB2019!
    ports:
      - 27017:27017
    volumes:
      - ./db:/data/db

  mongo-express:
    image: mongo-express
    ports:
      - 8081:8081
    environment:
      ME_CONFIG_BASICAUTH_USERNAME: admin
      ME_CONFIG_BASICAUTH_PASSWORD: password
      ME_CONFIG_MONGODB_PORT: 27017
      ME_CONFIG_MONGODB_ADMINUSERNAME: root
      ME_CONFIG_MONGODB_ADMINPASSWORD: MongoDB2019!
    depends_on:
      - mongo
```

とりあえず、現時点での最低構成はこんな感じです。
これを書いて`docker-compose up`して、`http://localhost:8081`か、もしくはローカルネットワーク上のサーバーで建てているのなら、`http://192.168.0.25:8081`のように接続すれば画像↓のようなコントロールパネルが出るかと思います。

![SnapCrab_NoName_2020-1-15_19-37-41_No-00.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/237514/e29c2708-8877-7082-d6b7-ce70d0163b45.png)

一応起動ログを貼っておきます。`dc up`は`docker-compose up`のaliasです。

<details><summary>起動ログ</summary><div>

```docker
❯ dc up
Creating mongodb_mongo_1 ... done
Creating mongodb_mongo-express_1 ... done
Attaching to mongodb_mongo_1, mongodb_mongo-express_1
mongo_1          | about to fork child process, waiting until server is ready for connections.
mongo-express_1  | Waiting for mongo:27017...
mongo-express_1  | /docker-entrypoint.sh: connect: Connection refused
mongo-express_1  | /docker-entrypoint.sh: line 14: /dev/tcp/mongo/27017: Connection refused
mongo_1          | forked process: 29
mongo_1          | 2020-01-15T10:52:59.769+0000 I  CONTROL  [main] ***** SERVER RESTARTED *****
mongo_1          | 2020-01-15T10:52:59.772+0000 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten] MongoDB starting : pid=29 port=27017 dbpath=/data/db 64-bit host=dce9d394b597
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten] db version v4.2.2
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten] git version: a0bbbff6ada159e19298d37946ac8dc4b497eadf
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten] allocator: tcmalloc
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten] modules: none
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten] build environment:
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten]     distmod: ubuntu1804
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten]     distarch: x86_64
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten]     target_arch: x86_64
mongo_1          | 2020-01-15T10:52:59.777+0000 I  CONTROL  [initandlisten] options: { net: { bindIp: "127.0.0.1", port: 27017, tls: { mode: "disabled" } }, processManagement: { fork: true, pidFilePath: "/tmp/docker-entrypoint-temp-mongod.pid" }, systemLog: { destination: "file", logAppend: true, path: "/proc/1/fd/1" } }
mongo_1          | 2020-01-15T10:52:59.778+0000 I  STORAGE  [initandlisten] 
mongo_1          | 2020-01-15T10:52:59.778+0000 I  STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
mongo_1          | 2020-01-15T10:52:59.778+0000 I  STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
mongo_1          | 2020-01-15T10:52:59.778+0000 I  STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3459M,cache_overflow=(file_max=0M),session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress],
mongo_1          | 2020-01-15T10:53:01.309+0000 I  STORAGE  [initandlisten] WiredTiger message [1579085581:309326][29:0x7f34c9ecfb00], txn-recover: Set global recovery timestamp: (0,0)
mongo_1          | 2020-01-15T10:53:01.899+0000 I  RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
mongo_1          | 2020-01-15T10:53:02.534+0000 I  STORAGE  [initandlisten] Timestamp monitor starting
mongo_1          | 2020-01-15T10:53:02.664+0000 I  CONTROL  [initandlisten] 
mongo_1          | 2020-01-15T10:53:02.664+0000 I  CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
mongo_1          | 2020-01-15T10:53:02.664+0000 I  CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
mongo_1          | 2020-01-15T10:53:02.665+0000 I  CONTROL  [initandlisten] 
mongo_1          | 2020-01-15T10:53:02.666+0000 I  STORAGE  [initandlisten] createCollection: admin.system.version with provided UUID: 61f1288b-0aee-4ec2-b2f7-b4b436c97534 and options: { uuid: UUID("61f1288b-0aee-4ec2-b2f7-b4b436c97534") }
mongo_1          | 2020-01-15T10:53:02.981+0000 I  INDEX    [initandlisten] index build: done building index _id_ on ns admin.system.version
mongo_1          | 2020-01-15T10:53:02.982+0000 I  SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:02.982+0000 I  COMMAND  [initandlisten] setting featureCompatibilityVersion to 4.2
mongo_1          | 2020-01-15T10:53:02.982+0000 I  SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:02.982+0000 I  STORAGE  [initandlisten] Flow Control is enabled on this deployment.
mongo_1          | 2020-01-15T10:53:02.982+0000 I  SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:02.982+0000 I  STORAGE  [initandlisten] createCollection: local.startup_log with generated UUID: d126ba6d-444a-4335-a898-3c4b30a3f607 and options: { capped: true, size: 10485760 }
mongo_1          | 2020-01-15T10:53:03.181+0000 I  INDEX    [initandlisten] index build: done building index _id_ on ns local.startup_log
mongo_1          | 2020-01-15T10:53:03.182+0000 I  SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:03.182+0000 I  FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
mongo_1          | 2020-01-15T10:53:03.184+0000 I  SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:03.184+0000 I  STORAGE  [LogicalSessionCacheRefresh] createCollection: config.system.sessions with provided UUID: 68a6970b-0429-438b-833f-cecf640e741e and options: { uuid: UUID("68a6970b-0429-438b-833f-cecf640e741e") }
mongo_1          | 2020-01-15T10:53:03.185+0000 I  NETWORK  [initandlisten] Listening on /tmp/mongodb-27017.sock
mongo_1          | 2020-01-15T10:53:03.185+0000 I  NETWORK  [initandlisten] Listening on 127.0.0.1
mongo_1          | 2020-01-15T10:53:03.185+0000 I  NETWORK  [initandlisten] waiting for connections on port 27017
mongo_1          | child process started successfully, parent exiting
mongo_1          | 2020-01-15T10:53:03.266+0000 I  NETWORK  [listener] connection accepted from 127.0.0.1:46500 #1 (1 connection now open)
mongo_1          | 2020-01-15T10:53:03.267+0000 I  NETWORK  [conn1] received client metadata from 127.0.0.1:46500 conn1: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.2.2" }, os: { type: "Linux", name: "Ubuntu", architecture: "x86_64", version: "18.04" } }
mongo_1          | 2020-01-15T10:53:03.273+0000 I  NETWORK  [conn1] end connection 127.0.0.1:46500 (0 connections now open)
mongo_1          | 2020-01-15T10:53:03.359+0000 I  NETWORK  [listener] connection accepted from 127.0.0.1:46502 #2 (1 connection now open)
mongo_1          | 2020-01-15T10:53:03.360+0000 I  NETWORK  [conn2] received client metadata from 127.0.0.1:46502 conn2: { application: { name: "MongoDB Shell" }, driver: { name: "MongoDB Internal Client", version: "4.2.2" }, os: { type: "Linux", name: "Ubuntu", architecture: "x86_64", version: "18.04" } }
mongo_1          | 2020-01-15T10:53:03.422+0000 I  SHARDING [conn2] Marking collection admin.system.users as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:03.422+0000 I  STORAGE  [conn2] createCollection: admin.system.users with generated UUID: 7e28a87f-2994-4ab0-a573-8b7f3339f672 and options: {}
mongo_1          | 2020-01-15T10:53:03.665+0000 I  INDEX    [LogicalSessionCacheRefresh] index build: done building index _id_ on ns config.system.sessions
mongo_1          | 2020-01-15T10:53:03.807+0000 I  INDEX    [conn2] index build: done building index _id_ on ns admin.system.users
mongo_1          | 2020-01-15T10:53:04.000+0000 I  SHARDING [ftdc] Marking collection local.oplog.rs as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:04.021+0000 I  INDEX    [conn2] index build: done building index user_1_db_1 on ns admin.system.users
mongo_1          | 2020-01-15T10:53:04.022+0000 I  COMMAND  [conn2] command admin.system.users appName: "MongoDB Shell" command: insert { insert: "system.users", bypassDocumentValidation: false, ordered: true, $db: "admin" } ninserted:1 keysInserted:2 numYields:0 reslen:45 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 3 } }, ReplicationStateTransition: { acquireCount: { w: 3 } }, Global: { acquireCount: { w: 3 } }, Database: { acquireCount: { W: 3 } }, Collection: { acquireCount: { r: 2, w: 2, W: 1 } }, Mutex: { acquireCount: { r: 5 } } } flowControl:{ acquireCount: 4 } storage:{} protocol:op_msg 599ms
mongo_1          | 2020-01-15T10:53:04.022+0000 I  COMMAND  [conn2] command admin.system.version appName: "MongoDB Shell" command: createUser { createUser: "root", pwd: "xxx", roles: [ { role: "root", db: "admin" } ], digestPassword: true, writeConcern: { w: "majority", wtimeout: 600000.0 }, lsid: { id: UUID("34513eac-e1e3-4e9d-94dc-6a1f4f8d2fcf") }, $db: "admin" } numYields:0 reslen:38 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 5 } }, ReplicationStateTransition: { acquireCount: { w: 6 } }, Global: { acquireCount: { r: 2, w: 4 } }, Database: { acquireCount: { r: 1, W: 4 } }, Collection: { acquireCount: { r: 3, w: 3, W: 1 } }, Mutex: { acquireCount: { r: 8 } } } flowControl:{ acquireCount: 4 } storage:{} protocol:op_msg 655ms
mongo_1          | Successfully added user: {
mongo_1          |      "user" : "root",
mongo_1          |      "roles" : [
mongo_1          |              {
mongo_1          |                      "role" : "root",
mongo_1          |                      "db" : "admin"
mongo_1          |              }
mongo_1          |      ]
mongo_1          | }
mongo_1          | 2020-01-15T10:53:04.025+0000 E  -        [main] Error saving history file: FileOpenFailed: Unable to open() file /home/mongodb/.dbshell: No such file or directory
mongo_1          | 2020-01-15T10:53:04.026+0000 I  NETWORK  [conn2] end connection 127.0.0.1:46502 (0 connections now open)
mongo_1          | 
mongo_1          | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
mongo_1          | 
mongo_1          | 2020-01-15T10:53:04.052+0000 I  CONTROL  [main] ***** SERVER RESTARTED *****
mongo_1          | 2020-01-15T10:53:04.056+0000 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
mongo_1          | killing process with pid: 29
mongo_1          | 2020-01-15T10:53:04.058+0000 I  CONTROL  [signalProcessingThread] got signal 15 (Terminated), will terminate after current cmd ends
mongo_1          | 2020-01-15T10:53:04.115+0000 I  INDEX    [LogicalSessionCacheRefresh] index build: starting on config.system.sessions properties: { v: 2, key: { lastUse: 1 }, name: "lsidTTLIndex", ns: "config.system.sessions", expireAfterSeconds: 1800 } using method: Hybrid
mongo_1          | 2020-01-15T10:53:04.115+0000 I  INDEX    [LogicalSessionCacheRefresh] build may temporarily use up to 500 megabytes of RAM
mongo_1          | 2020-01-15T10:53:04.115+0000 I  INDEX    [LogicalSessionCacheRefresh] index build: collection scan done. scanned 0 total records in 0 seconds
mongo_1          | 2020-01-15T10:53:04.116+0000 I  INDEX    [LogicalSessionCacheRefresh] index build: inserted 0 keys from external sorter into index in 0 seconds
mongo_1          | 2020-01-15T10:53:04.181+0000 I  INDEX    [LogicalSessionCacheRefresh] index build: done building index lsidTTLIndex on ns config.system.sessions
mongo-express_1  | Wed Jan 15 10:53:04 UTC 2020 retrying to connect to mongo:27017 (2/5)
mongo-express_1  | /docker-entrypoint.sh: connect: Connection refused
mongo-express_1  | /docker-entrypoint.sh: line 14: /dev/tcp/mongo/27017: Connection refused
mongo_1          | 2020-01-15T10:53:04.214+0000 I  COMMAND  [LogicalSessionCacheRefresh] command config.system.sessions command: createIndexes { createIndexes: "system.sessions", indexes: [ { key: { lastUse: 1 }, name: "lsidTTLIndex", expireAfterSeconds: 1800 } ], $db: "config" } numYields:0 reslen:114 locks:{ ParallelBatchWriterMode: { acquireCount: { r: 2 } }, ReplicationStateTransition: { acquireCount: { w: 3 } }, Global: { acquireCount: { r: 1, w: 2 } }, Database: { acquireCount: { r: 1, w: 2, W: 1 } }, Collection: { acquireCount: { r: 4, w: 1, R: 1, W: 2 } }, Mutex: { acquireCount: { r: 3 } } } flowControl:{ acquireCount: 1 } storage:{} protocol:op_msg 1029ms
mongo_1          | 2020-01-15T10:53:04.214+0000 I  COMMAND  [LogicalSessionCacheReap] command config.system.sessions command: listIndexes { listIndexes: "system.sessions", cursor: {}, $db: "config" } numYields:0 reslen:307 locks:{ ReplicationStateTransition: { acquireCount: { w: 1 } }, Global: { acquireCount: { r: 1 } }, Database: { acquireCount: { r: 1 }, acquireWaitCount: { r: 1 }, timeAcquiringMicros: { r: 1028961 } }, Collection: { acquireCount: { r: 1 } }, Mutex: { acquireCount: { r: 1 } } } storage:{} protocol:op_msg 1029ms
mongo_1          | 2020-01-15T10:53:04.214+0000 I  SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:04.214+0000 I  NETWORK  [signalProcessingThread] shutdown: going to close listening sockets...
mongo_1          | 2020-01-15T10:53:04.214+0000 I  NETWORK  [signalProcessingThread] removing socket file: /tmp/mongodb-27017.sock
mongo_1          | 2020-01-15T10:53:04.214+0000 I  -        [signalProcessingThread] Stopping further Flow Control ticket acquisitions.
mongo_1          | 2020-01-15T10:53:04.215+0000 I  CONTROL  [signalProcessingThread] Shutting down free monitoring
mongo_1          | 2020-01-15T10:53:04.215+0000 I  FTDC     [signalProcessingThread] Shutting down full-time diagnostic data capture
mongo_1          | 2020-01-15T10:53:04.217+0000 I  STORAGE  [signalProcessingThread] Deregistering all the collections
mongo_1          | 2020-01-15T10:53:04.217+0000 I  STORAGE  [signalProcessingThread] Timestamp monitor shutting down
mongo_1          | 2020-01-15T10:53:04.217+0000 I  STORAGE  [signalProcessingThread] WiredTigerKVEngine shutting down
mongo_1          | 2020-01-15T10:53:04.248+0000 I  STORAGE  [signalProcessingThread] Shutting down session sweeper thread
mongo_1          | 2020-01-15T10:53:04.248+0000 I  STORAGE  [signalProcessingThread] Finished shutting down session sweeper thread
mongo_1          | 2020-01-15T10:53:04.248+0000 I  STORAGE  [signalProcessingThread] Shutting down journal flusher thread
mongo_1          | 2020-01-15T10:53:04.281+0000 I  STORAGE  [signalProcessingThread] Finished shutting down journal flusher thread
mongo_1          | 2020-01-15T10:53:04.281+0000 I  STORAGE  [signalProcessingThread] Shutting down checkpoint thread
mongo_1          | 2020-01-15T10:53:04.282+0000 I  STORAGE  [signalProcessingThread] Finished shutting down checkpoint thread
mongo_1          | 2020-01-15T10:53:04.968+0000 I  STORAGE  [signalProcessingThread] shutdown: removing fs lock...
mongo_1          | 2020-01-15T10:53:04.968+0000 I  CONTROL  [signalProcessingThread] now exiting
mongo_1          | 2020-01-15T10:53:04.968+0000 I  CONTROL  [signalProcessingThread] shutting down with code:0
mongo_1          | 
mongo_1          | MongoDB init process complete; ready for start up.
mongo_1          | 
mongo_1          | 2020-01-15T10:53:05.127+0000 I  CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
mongo_1          | 2020-01-15T10:53:05.131+0000 I  CONTROL  [initandlisten] MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=dce9d394b597
mongo_1          | 2020-01-15T10:53:05.131+0000 I  CONTROL  [initandlisten] db version v4.2.2
mongo_1          | 2020-01-15T10:53:05.131+0000 I  CONTROL  [initandlisten] git version: a0bbbff6ada159e19298d37946ac8dc4b497eadf
mongo_1          | 2020-01-15T10:53:05.131+0000 I  CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1  11 Sep 2018
mongo_1          | 2020-01-15T10:53:05.131+0000 I  CONTROL  [initandlisten] allocator: tcmalloc
mongo_1          | 2020-01-15T10:53:05.132+0000 I  CONTROL  [initandlisten] modules: none
mongo_1          | 2020-01-15T10:53:05.132+0000 I  CONTROL  [initandlisten] build environment:
mongo_1          | 2020-01-15T10:53:05.132+0000 I  CONTROL  [initandlisten]     distmod: ubuntu1804
mongo_1          | 2020-01-15T10:53:05.132+0000 I  CONTROL  [initandlisten]     distarch: x86_64
mongo_1          | 2020-01-15T10:53:05.132+0000 I  CONTROL  [initandlisten]     target_arch: x86_64
mongo_1          | 2020-01-15T10:53:05.132+0000 I  CONTROL  [initandlisten] options: { net: { bindIp: "*" }, security: { authorization: "enabled" } }
mongo_1          | 2020-01-15T10:53:05.132+0000 I  STORAGE  [initandlisten] Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'.
mongo_1          | 2020-01-15T10:53:05.132+0000 I  STORAGE  [initandlisten] 
mongo_1          | 2020-01-15T10:53:05.132+0000 I  STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
mongo_1          | 2020-01-15T10:53:05.132+0000 I  STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
mongo_1          | 2020-01-15T10:53:05.132+0000 I  STORAGE  [initandlisten] wiredtiger_open config: create,cache_size=3459M,cache_overflow=(file_max=0M),session_max=33000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000,close_scan_interval=10,close_handle_minimum=250),statistics_log=(wait=0),verbose=[recovery_progress,checkpoint_progress],
mongo-express_1  | Wed Jan 15 10:53:05 UTC 2020 retrying to connect to mongo:27017 (3/5)
mongo-express_1  | /docker-entrypoint.sh: connect: Connection refused
mongo-express_1  | /docker-entrypoint.sh: line 14: /dev/tcp/mongo/27017: Connection refused
mongo_1          | 2020-01-15T10:53:05.953+0000 I  STORAGE  [initandlisten] WiredTiger message [1579085585:953805][1:0x7f1528d6ab00], txn-recover: Recovering log 1 through 2
mongo_1          | 2020-01-15T10:53:06.038+0000 I  STORAGE  [initandlisten] WiredTiger message [1579085586:38597][1:0x7f1528d6ab00], txn-recover: Recovering log 2 through 2
mongo_1          | 2020-01-15T10:53:06.121+0000 I  STORAGE  [initandlisten] WiredTiger message [1579085586:121060][1:0x7f1528d6ab00], txn-recover: Main recovery loop: starting at 1/28672 to 2/256
mongo-express_1  | Wed Jan 15 10:53:06 UTC 2020 retrying to connect to mongo:27017 (4/5)
mongo-express_1  | /docker-entrypoint.sh: connect: Connection refused
mongo-express_1  | /docker-entrypoint.sh: line 14: /dev/tcp/mongo/27017: Connection refused
mongo_1          | 2020-01-15T10:53:06.228+0000 I  STORAGE  [initandlisten] WiredTiger message [1579085586:228925][1:0x7f1528d6ab00], txn-recover: Recovering log 1 through 2
mongo_1          | 2020-01-15T10:53:06.335+0000 I  STORAGE  [initandlisten] WiredTiger message [1579085586:335502][1:0x7f1528d6ab00], txn-recover: Recovering log 2 through 2
mongo_1          | 2020-01-15T10:53:06.391+0000 I  STORAGE  [initandlisten] WiredTiger message [1579085586:391976][1:0x7f1528d6ab00], txn-recover: Set global recovery timestamp: (0,0)
mongo_1          | 2020-01-15T10:53:06.671+0000 I  RECOVERY [initandlisten] WiredTiger recoveryTimestamp. Ts: Timestamp(0, 0)
mongo_1          | 2020-01-15T10:53:06.676+0000 I  STORAGE  [initandlisten] Timestamp monitor starting
mongo_1          | 2020-01-15T10:53:06.762+0000 I  SHARDING [initandlisten] Marking collection local.system.replset as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:06.766+0000 I  STORAGE  [initandlisten] Flow Control is enabled on this deployment.
mongo_1          | 2020-01-15T10:53:06.766+0000 I  SHARDING [initandlisten] Marking collection admin.system.roles as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:06.766+0000 I  SHARDING [initandlisten] Marking collection admin.system.version as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:06.768+0000 I  SHARDING [initandlisten] Marking collection local.startup_log as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:06.768+0000 I  FTDC     [initandlisten] Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data'
mongo_1          | 2020-01-15T10:53:06.769+0000 I  SHARDING [LogicalSessionCacheRefresh] Marking collection config.system.sessions as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:06.769+0000 I  NETWORK  [initandlisten] Listening on /tmp/mongodb-27017.sock
mongo_1          | 2020-01-15T10:53:06.769+0000 I  NETWORK  [initandlisten] Listening on 0.0.0.0
mongo_1          | 2020-01-15T10:53:06.769+0000 I  NETWORK  [initandlisten] waiting for connections on port 27017
mongo_1          | 2020-01-15T10:53:06.769+0000 I  SHARDING [LogicalSessionCacheReap] Marking collection config.transactions as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:07.000+0000 I  SHARDING [ftdc] Marking collection local.oplog.rs as collection version: <unsharded>
mongo-express_1  | Wed Jan 15 10:53:07 UTC 2020 retrying to connect to mongo:27017 (5/5)
mongo_1          | 2020-01-15T10:53:07.195+0000 I  NETWORK  [listener] connection accepted from 172.23.0.3:54418 #1 (1 connection now open)
mongo_1          | 2020-01-15T10:53:07.195+0000 I  NETWORK  [conn1] end connection 172.23.0.3:54418 (0 connections now open)
mongo-express_1  | Welcome to mongo-express
mongo-express_1  | ------------------------
mongo-express_1  | 
mongo-express_1  | 
mongo-express_1  | Mongo Express server listening at http://0.0.0.0:8081
mongo-express_1  | Server is open to allow connections from anyone (0.0.0.0)
mongo_1          | 2020-01-15T10:53:07.872+0000 I  NETWORK  [listener] connection accepted from 172.23.0.3:54420 #2 (1 connection now open)
mongo_1          | 2020-01-15T10:53:07.896+0000 I  NETWORK  [conn2] received client metadata from 172.23.0.3:54420 conn2: { driver: { name: "nodejs", version: "2.2.24" }, os: { type: "Linux", name: "linux", architecture: "x64", version: "5.4.8-200.fc31.x86_64" }, platform: "Node.js v8.17.0, LE, mongodb-core: 2.1.8" }
mongo-express_1  | Database connected
mongo_1          | 2020-01-15T10:53:07.906+0000 I  SHARDING [conn2] Marking collection admin.system.users as collection version: <unsharded>
mongo_1          | 2020-01-15T10:53:08.045+0000 I  ACCESS   [conn2] Successfully authenticated as principal root on admin from client 172.23.0.3:54420
mongo-express_1  | Admin Database connected
mongo_1          | 2020-01-15T10:53:08.055+0000 I  NETWORK  [listener] connection accepted from 172.23.0.3:54422 #3 (2 connections now open)
mongo_1          | 2020-01-15T10:53:08.154+0000 I  ACCESS   [conn3] Successfully authenticated as principal root on admin from client 172.23.0.3:54422
```

</div></details>

Dockerで脳死最高！