Adding the -d flag will ensure that the Docker container runs as a background process, separate from the shell. Mongo | T13:11:44. You can start a MongoDB server running the latest version of MongoDB using Docker with the following command: >docker run -d -p 27017:27017 -name test-mongo mongo:latest This will pull the latest official image from Docker Hub. Mongo | T13:11:44.896 0000 I FTDC Initializing full-time diagnostic data capture with directory '/data/db/diagnostic.data' Mongo | T13:11:44.856 0000 I CONTROL ** Read and write access to data and configuration is unrestricted. It’s easy to make a project with docker as a container to images like MongoDB, Redis, Elastic Search, etc. Mongo | T13:11:44.856 0000 I CONTROL ** WARNING: Access control is not enabled for the database. Mongo | T13:11:44.759 0000 I STORAGE WiredTiger message, txn-recover: Set global recovery timestamp: 0 Mongo | T13:11:44.617 0000 I STORAGE WiredTiger message, txn-recover: Recovering log 2 through 2 Mongo | T13:11:44.434 0000 I STORAGE WiredTiger message, txn-recover: Recovering log 1 through 2 Mongo | T13:11:44.203 0000 I STORAGE WiredTiger message, txn-recover: Main recovery loop: starting at 1/16000 Mongo | T13:11:42.674 0000 I STORAGE wiredtiger_open config: create,cache_size=1454M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),cache_cursors=false,log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),statistics_log=(wait=0),verbose=(recovery_progress), Mongo | T13:11:42.674 0000 I STORAGE ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine Mongo | T13:11:42.674 0000 I - Detected data files in /data/db created by the 'wiredTiger' storage engine, so setting the active storage engine to 'wiredTiger'. This network will let each of your containers running in this network see each other. Mongo | T13:11:42.673 0000 I CONTROL MongoDB starting : pid=1 port=27017 dbpath=/data/db 64-bit host=8bf3032dbd8e Run the Docker compose Open Terminal, make sure you are still inside the mongodb folder and run: docker-compose build then docker-compose up 4. When I docker compose up (I commented out the whole sampleapi service section: this should allow anyone to quickly repro the issue), I get this: Starting mongo. Yet, this seems to be running, as it says waiting for connections on port 27017 just before the seed service is started. The mydb file is located in the same directory of this Dockerfile, anyway the issue is that it’s not connecting to the MongoDB service. The MongoSeed Dockerfile is just the mongo image with a CMD which runs mongorestore, connecting it to a host named after the mongo service in the composer (I tried with the default 127.0.0.1, but nothing changed): FROM mongoĬMD mongorestore -host mongodb://mongo:27017 -archive=/ -gzip Here is my docker-compose: version: '3.4'Ĭommand: mongod -smallfiles -logpath=/dev/null # -quiet Probably I’m missing something obvious, could anyone give a hint? Omitting nr.3 (as I did in this post) should make it even easier, yet I cannot have services 2 (and 3) connect to MongoDB. Zamana.I’m trying to build this scenario with docker-compose:Ģ.a run-once service, used to seed the MongoDB with a database ģ.an ASP.NET Core 2.1 web app accessing the MongoDB database. Go to Templates, Search NocoDB and click Deploy Railway Click to Expand Navigate to Templates Select hosting plan for your NocoDB applicationĪpplication will be build
0 Comments
Leave a Reply. |