Using Mongo through Docker on Apple Silicon

Has anyone successfully run Mongo using Docker on Apple Silicon? I'm getting some weird behavior when launching a container.

When I run a basic Mongo container it starts up fine, but then my prisma db push fails with the following error:
Error: MongoDB error
SCRAM failure: Authentication failed.
   0: migration_core::state::SchemaPush
             at migration-engine/core/src/state.rs:349

I read this is cause prisma needs a replication set, but when i add that to my compose file, the container doesn't want to initialize, and I get this in a continous loop:
{"t":{"$date":"2022-10-06T20:40:25.595+00:00"},"s":"I",  "c":"-",        "id":4939300, "ctx":"monitoring-keys-for-HMAC","msg":"Failed to refresh key cache","attr":{"error":"NotYetInitialized: Cannot use non-local read concern until replica set is finished initializing.","nextWakeupMillis":13000}}


This is the compose setup:
mongo:
    container_name: my-db
    image: mongo
    env_file:
      - .env.development
    volumes:
      - mongo_db:/data/db
    command: --replSet rs0 # this line here seems to be bad
    ports:
      - 27017:27017
    environment:
      MONGO_INITDB_DATABASE: ${DATABASE_NAME}


Any ideas? Anyone got prisma+mongo+docker to play nice?
PS: Not my choice to use Mongo
Was this page helpful?