From 4db53f89d00e08e8f741cb1c4f8489a34c8b2539 Mon Sep 17 00:00:00 2001 From: Amirhossein Khalili Date: Tue, 14 Jul 2026 11:12:10 +0330 Subject: [PATCH] fix(deploy): use non-avx mongo image by default --- .env.example | 1 + .env.production.example | 2 +- README.md | 2 ++ docker-compose.yml | 4 ++-- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index ccf6cd3..591f904 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,5 @@ APP_ENV=local +MONGO_IMAGE=mongo:4.4.29-focal MONGO_URI=mongodb://localhost:27017 MONGO_DB_NAME=gapido_auth REDIS_URL=redis://localhost:6379/0 diff --git a/.env.production.example b/.env.production.example index 6f1b829..16b9c81 100644 --- a/.env.production.example +++ b/.env.production.example @@ -1,4 +1,5 @@ APP_ENV=production +MONGO_IMAGE=mongo:4.4.29-focal MONGO_DB_NAME=gapido_auth JWT_SECRET_KEY=replace-with-a-long-random-production-secret JWT_ISSUER=gapido-auth @@ -21,4 +22,3 @@ DEMO_ENABLE_DEBUG_OTP=false DEMO_DEBUG_SMS_TTL_SECONDS=300 GRPC_HOST=0.0.0.0 GRPC_PORT=50051 - diff --git a/README.md b/README.md index 570759f..ef0716b 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,8 @@ Before running production, set real values in `.env.production`: Only ports `80` and `443` are published in the production Compose overlay. MongoDB, Redis, RabbitMQ, gRPC, and the FastAPI demo service stay private on the Docker network. +The Compose default uses `MONGO_IMAGE=mongo:4.4.29-focal` because MongoDB 5.0+ requires AVX CPU support. On newer hosts you can override it with a newer MongoDB image, for example `MONGO_IMAGE=mongo:7`. + ## SMS Provider The SMS integration uses the Strategy pattern behind the `SmsClient` port. Select the provider with: diff --git a/docker-compose.yml b/docker-compose.yml index 4200945..d6ddcb9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -77,11 +77,11 @@ services: condition: service_healthy mongo: - image: mongo:7 + image: ${MONGO_IMAGE:-mongo:4.4.29-focal} volumes: - mongo-data:/data/db healthcheck: - test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping').ok"] + test: ["CMD-SHELL", "mongosh --quiet --eval \"db.adminCommand('ping').ok\" || mongo --quiet --eval \"db.adminCommand('ping').ok\""] interval: 5s timeout: 5s retries: 20