services: redis: image: redis:latest restart: always ports: - "6379:6379" # ✅ Expose Redis to host volumes: - ./redis/data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 30s timeout: 10s retries: 5 start_period: 5s mongodb: image: mongo:latest restart: always ports: - "27017:27017" # ✅ Expose MongoDB to host command: ["mongod", "--quiet", "--replSet", "rs0", "--bind_ip_all"] volumes: - ./mongo/data:/data/db healthcheck: test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'localhost:27017'}]}) }" | mongosh --port 27017 --quiet interval: 5s timeout: 30s start_period: 0s start_interval: 1s retries: 30