2026-04-03 15:06:34 +08:00
|
|
|
services:
|
|
|
|
|
litellm:
|
2026-04-03 15:07:11 +08:00
|
|
|
image: ghcr.io/berriai/litellm:v1.83.0-nightly
|
2026-04-03 15:06:34 +08:00
|
|
|
container_name: ${CONTAINER_NAME}
|
|
|
|
|
#########################################
|
|
|
|
|
## Uncomment these lines to start proxy with a config.yaml file ##
|
|
|
|
|
# volumes:
|
|
|
|
|
# - ./config.yaml:/app/config.yaml
|
|
|
|
|
# command:
|
|
|
|
|
# - "--config=/app/config.yaml"
|
|
|
|
|
##############################################
|
|
|
|
|
ports:
|
2026-04-03 15:07:11 +08:00
|
|
|
- "${PANEL_APP_PORT_HTTP}:4000"
|
2026-04-03 15:06:34 +08:00
|
|
|
environment:
|
|
|
|
|
DATABASE_URL: "postgresql://llmproxy:dbpassword9090@db:5432/litellm"
|
2026-04-03 15:07:11 +08:00
|
|
|
STORE_MODEL_IN_DB: "True"
|
2026-04-03 15:06:34 +08:00
|
|
|
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY}
|
|
|
|
|
depends_on:
|
2026-04-03 15:07:11 +08:00
|
|
|
- db
|
|
|
|
|
healthcheck:
|
|
|
|
|
test: [ "CMD-SHELL", "wget --no-verbose --tries=1 http://localhost:4000/health/liveliness || exit 1" ]
|
|
|
|
|
interval: 30s
|
|
|
|
|
timeout: 10s
|
|
|
|
|
retries: 3
|
|
|
|
|
start_period: 40s
|
2026-04-03 15:06:34 +08:00
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
- 1panel-network
|
|
|
|
|
labels:
|
|
|
|
|
createdBy: "Apps"
|
|
|
|
|
db:
|
|
|
|
|
image: postgres:16
|
|
|
|
|
restart: always
|
|
|
|
|
container_name: ${CONTAINER_NAME}-db
|
|
|
|
|
environment:
|
|
|
|
|
POSTGRES_DB: litellm
|
|
|
|
|
POSTGRES_USER: llmproxy
|
|
|
|
|
POSTGRES_PASSWORD: dbpassword9090
|
|
|
|
|
ports:
|
|
|
|
|
- "5432:5432"
|
|
|
|
|
volumes:
|
2026-04-03 15:07:11 +08:00
|
|
|
- postgres_data:/var/lib/postgresql/data
|
2026-04-03 15:06:34 +08:00
|
|
|
healthcheck:
|
|
|
|
|
test: ["CMD-SHELL", "pg_isready -d litellm -U llmproxy"]
|
|
|
|
|
interval: 1s
|
|
|
|
|
timeout: 5s
|
|
|
|
|
retries: 10
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
- 1panel-network
|
|
|
|
|
labels:
|
|
|
|
|
createdBy: "Apps"
|
|
|
|
|
prometheus:
|
|
|
|
|
image: prom/prometheus
|
|
|
|
|
container_name: ${CONTAINER_NAME}-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
|
|
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
- 1panel-network
|
|
|
|
|
labels:
|
|
|
|
|
createdBy: "Apps"
|
|
|
|
|
volumes:
|
|
|
|
|
prometheus_data:
|
|
|
|
|
driver: local
|
|
|
|
|
postgres_data:
|
2026-04-03 15:07:11 +08:00
|
|
|
name: litellm_postgres_data
|
2026-04-03 15:06:34 +08:00
|
|
|
|
|
|
|
|
networks:
|
|
|
|
|
1panel-network:
|
2026-04-03 15:07:11 +08:00
|
|
|
external: true
|