Business
Jobs
  • About Us
  • Solutions
    • Candidates
      Highly qualified candidates in 48h.
    • Assessments
      500+ technical and psychological assessments, plus anti-fraud system.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Pay in 15+ LATAM countries without setting up a local entity.
  • Pricing
  • Jobs

0

260
Views
¿Cómo agregar --auth para la imagen mongodb cuando se usa docker-compose?

Estoy usando docker-compose para ejecutar mi proyecto creado por node,mongodb,nginx;

y he construido el proyecto usando docker build

y luego uso docker up -d nginx para iniciar mi proyecto. pero no he encontrado la configuración para ejecutar la imagen de mongodb con '--auth', entonces, ¿cómo agregar '--auth' cuando componer iniciar el mongodb?

aquí está mi docker-compose.yml:

 version: "2" services: mongodb: image: mongo:latest expose: - "27017" volumes: - "/home/open/mymongo:/data/db" nginx: build: /home/open/mynginx/ ports: - "8080:8080" - "80:80" links: - node_server:node node_server: build: /home/laoqiren/workspace/isomorphic-redux-CNode/ links: - mongodb:mongo expose: - "3000"
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Proporcione un command al contenedor que incluya la opción --auth .

 mongodb: image: mongo:latest expose: - "27017" volumes: - "/home/open/mymongo:/data/db" command: mongod --auth

Los últimos contenedores mongo vienen con inicialización de autenticación "raíz" a través de variables de entorno también, modeladas en la configuración de postgres.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!