Fix Docker networking and add graceful MongoDB error handling

- Fix DNS resolution: Removed invalid dns_search configuration
- Add graceful MongoDB connection error handling
- Set restart policy to 'unless-stopped' for both services
- Add development helper scripts (start-dev.sh, stop-dev.sh)
- Update Docker Compose configurations for development
- Restore main.rs from git history
- Backend now logs MongoDB errors without crashing

All containers now start successfully with proper DNS resolution
on the dedicated normogen-network.
This commit is contained in:
goose 2026-02-23 07:58:57 -03:00
parent 177f2ad8e7
commit cd5c1709c6
7 changed files with 277 additions and 64 deletions

View file

@ -11,7 +11,6 @@ services:
- '6500:8000'
volumes:
- ./src:/app/src
# Mount a volume to capture logs
- startup-logs:/tmp
environment:
- RUST_LOG=debug
@ -26,8 +25,8 @@ services:
condition: service_healthy
networks:
- normogen-network
# DISABLE RESTART TEMPORARILY TO DEBUG
restart: "no"
restart: unless-stopped
mongodb:
image: mongo:6.0
container_name: normogen-mongodb-dev
@ -47,11 +46,14 @@ services:
timeout: 5s
retries: 5
start_period: 60s
restart: unless-stopped
volumes:
mongodb_dev_data:
driver: local
startup-logs:
driver: local
networks:
normogen-network:
driver: bridge