Corrected Indentation in docker-compose.dev.yml

It didn't use the volumes as parameter, instead it defined a service called volumes and services don't have a parameter called mongodb. Corrected indentation in yml file
This commit is contained in:
Dharmjeet Kumar 2020-11-09 22:56:00 +05:30 committed by GitHub
parent 1decdd31a7
commit 93a91c7ff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 20 deletions

View File

@ -27,28 +27,28 @@ version: '3.8'
services: services:
notes: notes:
build: build:
context: . context: .
ports: ports:
- 8080:8080 - 8080:8080
- 9229:9229 - 9229:9229
environment: environment:
- SERVER_PORT=8080 - SERVER_PORT=8080
- DATABASE_CONNECTIONSTRING=mongodb://mongo:27017/notes - DATABASE_CONNECTIONSTRING=mongodb://mongo:27017/notes
volumes: volumes:
- ./:/code - ./:/code
command: npm run debug command: npm run debug
mongo: mongo:
image: mongo:4.2.8 image: mongo:4.2.8
ports: ports:
- 27017:27017 - 27017:27017
volumes: volumes:
- mongodb:/data/db - mongodb:/data/db
- mongodb_config:/data/configdb - mongodb_config:/data/configdb
volumes: volumes:
mongodb: mongodb:
mongodb_config: mongodb_config:
``` ```
This Compose file is super convenient as we do not have to type all the parameters to pass to the `docker run` command. We can declaratively do that in the Compose file. This Compose file is super convenient as we do not have to type all the parameters to pass to the `docker run` command. We can declaratively do that in the Compose file.