build(docker-compose.yml): startup docker compose with postgres

This commit is contained in:
Krrish Dholakia 2024-06-01 16:18:12 -07:00
parent b8df5d1a01
commit 9b4a19b3aa
2 changed files with 33 additions and 6 deletions

View file

@ -1,16 +1,26 @@
version: "3.9" version: "3.11"
services: services:
litellm: litellm:
build: build:
context: . context: .
args: args:
target: runtime target: runtime
image: ghcr.io/berriai/litellm:main-latest image: ghcr.io/berriai/litellm:main-stable
ports: ports:
- "4000:4000" # Map the container port to the host, change the host port if necessary - "4000:4000" # Map the container port to the host, change the host port if necessary
volumes: environment:
- ./litellm-config.yaml:/app/config.yaml # Mount the local configuration file DATABASE_URL: "postgresql://postgres:example@db:5432/postgres"
# You can change the port or number of workers as per your requirements or pass any new supported CLI augument. Make sure the port passed here matches with the container port defined above in `ports` value STORE_MODEL_IN_DB: "True" # allows adding models to proxy via UI
command: [ "--config", "/app/config.yaml", "--port", "4000", "--num_workers", "8" ]
db:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: example
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 1s
timeout: 5s
retries: 10
# ...rest of your docker-compose config if any # ...rest of your docker-compose config if any

View file

@ -7,6 +7,23 @@ You can find the Dockerfile to build litellm proxy [here](https://github.com/Ber
## Quick Start ## Quick Start
To start using Litellm, run the following commands in a shell:
```bash
# Get the code
git clone https://github.com/BerriAI/litellm
# Go to folder
cd litellm
# Add the master key
echo 'LITELLM_MASTER_KEY="sk-1234"' > .env
source .env
# Start
docker-compose up
```
<Tabs> <Tabs>
<TabItem value="basic" label="Basic"> <TabItem value="basic" label="Basic">