Arrumar problema de conexão com banco de dados

parent e9a975c6
......@@ -2,37 +2,18 @@
version: "3.7"
services:
mongo-express:
image: mongo-express
ports:
- "8081:8081"
environment:
ME_CONFIG_BASICAUTH_USERNAME: usereventos
ME_CONFIG_BASICAUTH_PASSWORD: 123
ME_CONFIG_MONGODB_PORT: 27017
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: eventos
links:
- mongo
networks:
- mongo-compose-network
mongo:
image: mongo
restart: always
database:
image: "mongo"
container_name: "eventos-nosql"
environment:
MONGO_INITDB_DATABASE: eventos
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: eventos
ports:
- "27017:27017"
volumes:
- ./data/db
networks:
- mongo-compose-network
networks:
mongo-compose-network:
driver: bridge
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
- ./mongo-volume:/data/db
volumes:
db:
db.createUser({
user: "root",
pwd: "eventos",
roles: [
{
role: "readWrite",
db: "eventos",
},
],
});
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment