diff --git a/docker-compose.yaml b/docker-compose.yaml index 46fc8ec..10a2f47 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -9,9 +9,18 @@ services: - mongodb - mailhog mongodb: - image: "mongo:latest" + image: mongo:7 + container_name: mongodb ports: - - 27017:27017 + - '27017:27017' + command: mongod --replSet rs0 + healthcheck: + test: | + mongosh --eval "try { rs.status().ok } catch (e) { rs.initiate({ _id: 'rs0', members: [{ _id: 0, host: 'localhost:27017' }] }).ok }" + start_period: 0s + interval: 500ms + timeout: 5s + retries: 5 mailhog: image: "mailhog/mailhog:latest" ports: