This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds docker with Ollama support
- Loading branch information
Showing
1 changed file
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
version: '3.7' | ||
|
||
services: | ||
backend: | ||
build: . | ||
command: uvicorn app.main:app --reload --host 0.0.0.0 --port 8050 --proxy-headers | ||
volumes: | ||
- ./src/:/app/ | ||
ports: | ||
- "8050:8050" | ||
environment: | ||
- SUPERADMIN_GH_PAT=${SUPERADMIN_GH_PAT} | ||
- SUPERADMIN_PWD=${SUPERADMIN_PWD} | ||
- GH_OAUTH_ID=${GH_OAUTH_ID} | ||
- GH_OAUTH_SECRET=${GH_OAUTH_SECRET} | ||
- POSTGRES_URL=postgresql+asyncpg://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db/${POSTGRES_DB} | ||
- OPENAI_API_KEY=${OPENAI_API_KEY} | ||
- SECRET_KEY=${SECRET_KEY} | ||
- SENTRY_DSN=${SENTRY_DSN} | ||
- SERVER_NAME=${SERVER_NAME} | ||
- POSTHOG_KEY=${POSTHOG_KEY} | ||
- SLACK_API_TOKEN=${SLACK_API_TOKEN} | ||
- SLACK_CHANNEL=${SLACK_CHANNEL} | ||
- OLLAMA_ENDPOINT=http://ollama:11434 | ||
- OLLAMA_MODEL=${OLLAMA_MODEL} | ||
- SUPPORT_EMAIL=${SUPPORT_EMAIL} | ||
- DEBUG=true | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
ollama: | ||
condition: service_healthy | ||
|
||
ollama: | ||
image: ollama/ollama:latest | ||
command: serve && ollama pull ${OLLAMA_MODEL} | ||
volumes: | ||
- "$HOME/.ollama:/root/.ollama" | ||
expose: | ||
- 11434 | ||
healthcheck: | ||
test: ["CMD-SHELL", "ollama list | grep -q '${OLLAMA_MODEL}'"] | ||
interval: 10s | ||
timeout: 3s | ||
retries: 3 | ||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
count: 1 | ||
capabilities: [gpu] | ||
|
||
# ollama-webui: | ||
# image: ghcr.io/ollama-webui/ollama-webui:main | ||
# container_name: ollama-webui | ||
# depends_on: | ||
# - ollama | ||
# # Uncomment below for WIP: Auth support | ||
# # - ollama-webui-db | ||
# ports: | ||
# - 3000:8080 | ||
# environment: | ||
# - "OLLAMA_API_BASE_URL=http://ollama:11434/api" | ||
# # Uncomment below for WIP: Auth support | ||
# # - "WEBUI_AUTH=TRUE" | ||
# # - "WEBUI_DB_URL=mongodb://root:example@ollama-webui-db:27017/" | ||
# # - "WEBUI_JWT_SECRET_KEY=SECRET_KEY" | ||
# # extra_hosts: | ||
# # - host.docker.internal:host-gateway | ||
# # restart: unless-stopped | ||
|
||
db: | ||
image: postgres:15-alpine | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data/ | ||
expose: | ||
- 5432 | ||
environment: | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
- POSTGRES_DB=${POSTGRES_DB} | ||
healthcheck: | ||
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'"] | ||
interval: 10s | ||
timeout: 3s | ||
retries: 3 | ||
|
||
volumes: | ||
postgres_data: | ||
ollama: |