Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

357
Views
Why can't I use azure file share in my docker-compose to store mongodb data in Azure Container Instance?

When using a docker ACI context, the following docker-compose file fails. The mongodb container continuously restarts.

version: "3.9"

services:
  mongodb:
    image: mongo:5.0.6
    env_file: mongo.env
    environment:
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=changeit
    ports:
      - 27017
    volumes:
      - dbdata:/data/db

volumes:
  dbdata:
    driver: azure_file
    driver_opts:
      share_name: mongodb-data
      storage_account_name: kpncoqyuxumoetuftz

If I don't use the azure_file storage it will run ok (But of course the data won't be persistent)

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

I am not sure why I can't mount to the default directory /data/db but to get this to work I had to mount to a different directory and then replace the default command with one that takes a parameter.

Working version is below:

version: "3.9"

services:
  mongodb:
    image: mongo:5.0.6
    command: ["mongod", "--dbpath=/dbdata"]
    environment:
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=changeit
    ports:
      - 27017
    volumes:
      - dbdata:/dbdata

volumes:
  dbdata:
    driver: azure_file
    driver_opts:
      share_name: mongodb-data
      storage_account_name: kpncoqyuxumoetuftz

over 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 Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!