Skip to content

Commit b19529a

Browse files
committed
fix docker compose
1 parent 9288356 commit b19529a

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

docker-compose.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
version: "3.11"
22
services:
3+
litellm:
4+
build:
5+
context: .
6+
args:
7+
target: runtime
8+
image: ghcr.io/berriai/litellm:main-stable
9+
#########################################
10+
## Uncomment these lines to start proxy with a config.yaml file ##
11+
# volumes:
12+
# - ./config.yaml:/app/config.yaml <<- this is missing in the docker-compose file currently
13+
# command:
14+
# - "--config=/app/config.yaml"
15+
##############################################
16+
ports:
17+
- "4000:4000" # Map the container port to the host, change the host port if necessary
18+
environment:
19+
DATABASE_URL: "postgresql://llmproxy:dbpassword9090@db:5432/litellm"
20+
STORE_MODEL_IN_DB: "True" # allows adding models to proxy via UI
21+
env_file:
22+
- .env # Load local .env file
23+
depends_on:
24+
- db # Indicates that this service depends on the 'db' service, ensuring 'db' starts first
25+
healthcheck: # Defines the health check configuration for the container
26+
test: [ "CMD", "curl", "-f", "http://localhost:4000/health/liveliness || exit 1" ] # Command to execute for health check
27+
interval: 30s # Perform health check every 30 seconds
28+
timeout: 10s # Health check command times out after 10 seconds
29+
retries: 3 # Retry up to 3 times if health check fails
30+
start_period: 40s # Wait 40 seconds after container start before beginning health checks
31+
32+
333
db:
434
image: postgres:16
535
restart: always
@@ -16,3 +46,23 @@ services:
1646
interval: 1s
1747
timeout: 5s
1848
retries: 10
49+
50+
prometheus:
51+
image: prom/prometheus
52+
volumes:
53+
- prometheus_data:/prometheus
54+
- ./prometheus.yml:/etc/prometheus/prometheus.yml
55+
ports:
56+
- "9090:9090"
57+
command:
58+
- '--config.file=/etc/prometheus/prometheus.yml'
59+
- '--storage.tsdb.path=/prometheus'
60+
- '--storage.tsdb.retention.time=15d'
61+
restart: always
62+
63+
volumes:
64+
prometheus_data:
65+
driver: local
66+
postgres_data:
67+
name: litellm_postgres_data # Named volume for Postgres data persistence
68+

0 commit comments

Comments
 (0)