Initial commit

This commit is contained in:
kyy
2025-01-14 14:33:35 +09:00
parent 9aab12ed50
commit 75b9c50e7b

74
docker-compose.yml Normal file
View File

@@ -0,0 +1,74 @@
version: "3.8"
services:
llm-asyncio:
build:
context: .
dockerfile: Dockerfile
shm_size: "1000gb"
volumes:
- ./workspace:/opt/workspace/
- ./cache:/root/.cache/
- ../model:/opt/model/
environment:
PYTORCH_CUDA_ALLOC_CONF: expandable_segments:True
PYTHONPATH: /opt/workspace/
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: "all"
capabilities: [gpu]
container_name: llm-asyncio
ports:
- "8000:8000"
networks:
- llm-network
entrypoint: >
/bin/bash -c "
uvicorn main:app --reload --host 0.0.0.0 --port 8000
"
tty: true
redis:
image: redis:latest
container_name: redis-server
ports:
- "6380:6380"
restart: always
networks:
- llm-network
worker:
build:
context: .
dockerfile: Dockerfile
shm_size: "1000gb"
volumes:
- ./workspace:/opt/workspace/
- ./cache:/root/.cache/
- ../model:/opt/model/
environment:
PYTORCH_CUDA_ALLOC_CONF: expandable_segments:True
PYTHONPATH: /opt/workspace/
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: "all"
capabilities: [gpu]
networks:
- llm-network
entrypoint: >
/bin/bash -c "
python /opt/workspace/worker.py
"
restart: always
tty: true
scale: 2
networks:
llm-network:
driver: bridge