Phase 2.1: Backend project initialized with Docker configuration
- Created Cargo.toml with all required dependencies - Implemented health/ready endpoints - Added Docker configuration (production + development) - Configured docker-compose with resource limits - Set up MongoDB service with persistence - Verified build (cargo check passed) - Prepared monorepo structure for mobile/web/shared Next: Phase 2.2 (MongoDB connection and models)
This commit is contained in:
parent
4dca44dbbe
commit
1e38fe3ace
11 changed files with 388 additions and 80 deletions
57
backend/docker-compose.yml
Normal file
57
backend/docker-compose.yml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
version: '3.8'
|
||||
services:
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: docker/Dockerfile
|
||||
container_name: normogen-backend
|
||||
ports:
|
||||
- '6000:8000'
|
||||
environment:
|
||||
- RUST_LOG=info
|
||||
- SERVER_PORT=8000
|
||||
- MONGODB_URI=mongodb://mongodb:27017
|
||||
- MONGODB_DATABASE=normogen
|
||||
env_file:
|
||||
- .env
|
||||
depends_on:
|
||||
mongodb:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- normogen-network
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '1.0'
|
||||
memory: 1000M
|
||||
healthcheck:
|
||||
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost:8000/health']
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
mongodb:
|
||||
image: mongo:6.0
|
||||
container_name: normogen-mongodb
|
||||
ports:
|
||||
- '27017:27017'
|
||||
environment:
|
||||
- MONGO_INITDB_DATABASE=normogen
|
||||
volumes:
|
||||
- mongodb_data:/data/db
|
||||
networks:
|
||||
- normogen-network
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ['CMD', 'mongosh', '--eval', 'db.adminCommand.ping()']
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
start_period: 10s
|
||||
volumes:
|
||||
mongodb_data:
|
||||
driver: local
|
||||
networks:
|
||||
normogen-network:
|
||||
driver: bridge
|
||||
Loading…
Add table
Add a link
Reference in a new issue