Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ nilai.egg-info
dist
db/*
caddy/caddy_config
caddy/caddy_data
caddy/caddy_data
tests/
28 changes: 21 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
version: '3.8'

services:
etcd:
image: 'bitnami/etcd:latest'
environment:
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
# ports:
# - 2379:2379
# - 2380:2380
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
networks:
- backend_net

api:
build:
context: .
dockerfile: docker/api.Dockerfile
target: nilai
depends_on:
- etcd
etcd:
condition: service_healthy
volumes:
- ${PWD}/db/:/app/db/ # sqlite database for users
environment:
- ETCD_HOST=etcd
- ETCD_PORT=2379
networks:
- backend_net

llama_1b_cpu:
build:
context: .
Expand All @@ -31,7 +39,8 @@ services:
args:
MODEL_NAME: "llama_1b_cpu"
depends_on:
- etcd
etcd:
condition: service_healthy
environment:
- SVC_HOST=llama_1b_cpu
- SVC_PORT=8000
Expand All @@ -41,6 +50,7 @@ services:
- hugging_face_models:/root/.cache/huggingface # cache models
networks:
- backend_net

llama_8b_cpu:
build:
context: .
Expand All @@ -49,7 +59,8 @@ services:
args:
MODEL_NAME: "llama_8b_cpu"
depends_on:
- etcd
etcd:
condition: service_healthy
environment:
- SVC_HOST=llama_8b_cpu
- SVC_PORT=8000
Expand All @@ -59,6 +70,7 @@ services:
- hugging_face_models:/root/.cache/huggingface # cache models
networks:
- backend_net

secret_llama_1b_cpu:
build:
context: .
Expand All @@ -67,7 +79,8 @@ services:
args:
MODEL_NAME: "secret_llama_1b_cpu"
depends_on:
- etcd
etcd:
condition: service_healthy
environment:
- SVC_HOST=secret_llama_1b_cpu
- SVC_PORT=8000
Expand All @@ -77,6 +90,7 @@ services:
- hugging_face_models:/root/.cache/huggingface # cache models
networks:
- backend_net

volumes:
hugging_face_models:

Expand Down