Refactors backend deployment to: - Use MOTOR_MAX_WORKERS (defaulting to 1) to reduce threads used by mongodb connections - Also sets backend workers to 1 by default to reduce default memory usage - Switches to gunicorn with uvloop worker for production use instead of uvicorn (as recommended by uvicorn) Lower thread count should address memory leak/increased usage, which resulted in 5x thread x cpus x workers, eg. potentially 20 or 40 threads just for mongodb connections. Lower default number of workers should make it easier to scale backend with HPA if additional capacity. Fixes #1467
		
			
				
	
	
		
			12 lines
		
	
	
		
			165 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			165 B
		
	
	
	
		
			Docker
		
	
	
	
	
	
| FROM docker.io/library/python:3.10-slim
 | |
| 
 | |
| WORKDIR /app
 | |
| 
 | |
| ADD requirements.txt /app
 | |
| 
 | |
| RUN pip install -r requirements.txt
 | |
| 
 | |
| ADD btrixcloud/ /app/btrixcloud/
 | |
| 
 | |
| EXPOSE 8000
 |