mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix docker compose
This commit is contained in:
parent
92883560f0
commit
b19529a46e
1 changed files with 50 additions and 0 deletions
|
@ -1,5 +1,35 @@
|
||||||
version: "3.11"
|
version: "3.11"
|
||||||
services:
|
services:
|
||||||
|
litellm:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args:
|
||||||
|
target: runtime
|
||||||
|
image: ghcr.io/berriai/litellm:main-stable
|
||||||
|
#########################################
|
||||||
|
## Uncomment these lines to start proxy with a config.yaml file ##
|
||||||
|
# volumes:
|
||||||
|
# - ./config.yaml:/app/config.yaml <<- this is missing in the docker-compose file currently
|
||||||
|
# command:
|
||||||
|
# - "--config=/app/config.yaml"
|
||||||
|
##############################################
|
||||||
|
ports:
|
||||||
|
- "4000:4000" # Map the container port to the host, change the host port if necessary
|
||||||
|
environment:
|
||||||
|
DATABASE_URL: "postgresql://llmproxy:dbpassword9090@db:5432/litellm"
|
||||||
|
STORE_MODEL_IN_DB: "True" # allows adding models to proxy via UI
|
||||||
|
env_file:
|
||||||
|
- .env # Load local .env file
|
||||||
|
depends_on:
|
||||||
|
- db # Indicates that this service depends on the 'db' service, ensuring 'db' starts first
|
||||||
|
healthcheck: # Defines the health check configuration for the container
|
||||||
|
test: [ "CMD", "curl", "-f", "http://localhost:4000/health/liveliness || exit 1" ] # Command to execute for health check
|
||||||
|
interval: 30s # Perform health check every 30 seconds
|
||||||
|
timeout: 10s # Health check command times out after 10 seconds
|
||||||
|
retries: 3 # Retry up to 3 times if health check fails
|
||||||
|
start_period: 40s # Wait 40 seconds after container start before beginning health checks
|
||||||
|
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
restart: always
|
restart: always
|
||||||
|
@ -16,3 +46,23 @@ services:
|
||||||
interval: 1s
|
interval: 1s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|
||||||
|
prometheus:
|
||||||
|
image: prom/prometheus
|
||||||
|
volumes:
|
||||||
|
- prometheus_data:/prometheus
|
||||||
|
- ./prometheus.yml:/etc/prometheus/prometheus.yml
|
||||||
|
ports:
|
||||||
|
- "9090:9090"
|
||||||
|
command:
|
||||||
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
||||||
|
- '--storage.tsdb.path=/prometheus'
|
||||||
|
- '--storage.tsdb.retention.time=15d'
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
prometheus_data:
|
||||||
|
driver: local
|
||||||
|
postgres_data:
|
||||||
|
name: litellm_postgres_data # Named volume for Postgres data persistence
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue