This commit is contained in:
peaklabs-dev
2024-10-11 00:16:48 +02:00
parent 2d15724320
commit ccc2310110

View File

@@ -2,8 +2,7 @@
# slogan: Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production. # slogan: Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
# tags: ai, weaviate, openai, gpt, llm, lmops, dify, redis, postgres, qdrant, RAG, agent # tags: ai, weaviate, openai, gpt, llm, lmops, dify, redis, postgres, qdrant, RAG, agent
# logo: svgs/dify.png # logo: svgs/dify.png
# port: 80 # port: 3000
x-shared-env: &shared-api-worker-env x-shared-env: &shared-api-worker-env
LOG_LEVEL: ${LOG_LEVEL:-INFO} LOG_LEVEL: ${LOG_LEVEL:-INFO}
@@ -152,10 +151,8 @@ x-shared-env: &shared-api-worker-env
SSRF_PROXY_HTTPS_URL: ${SSRF_PROXY_HTTPS_URL:-http://ssrf_proxy:3128} SSRF_PROXY_HTTPS_URL: ${SSRF_PROXY_HTTPS_URL:-http://ssrf_proxy:3128}
services: services:
# API service
api: api:
image: langgenius/dify-api:latest image: langgenius/dify-api:latest
restart: always
environment: environment:
SECRET_KEY: $SERVICE_PASSWORD_64_SECRETKEY SECRET_KEY: $SERVICE_PASSWORD_64_SECRETKEY
INIT_PASSWORD: $SERVICE_USER_INITPASSWORD INIT_PASSWORD: $SERVICE_USER_INITPASSWORD
@@ -164,11 +161,13 @@ services:
# Startup mode, 'api' starts the API server. # Startup mode, 'api' starts the API server.
MODE: api MODE: api
depends_on: depends_on:
- db db:
- redis condition: service_healthy
redis:
condition: service_healthy
volumes: volumes:
# Mount the storage directory to the container, for storing user files. # Mount the storage directory to the container, for storing user files.
- './volumes/app/storage:/app/api/storage' - dify-storage:/app/api/storage
networks: networks:
- ssrf_proxy_network - ssrf_proxy_network
- default - default
@@ -183,18 +182,19 @@ services:
# The Celery worker for processing the queue. # The Celery worker for processing the queue.
worker: worker:
image: langgenius/dify-api:latest image: langgenius/dify-api:latest
restart: always
environment: environment:
# Use the shared environment variables. # Use the shared environment variables.
<<: *shared-api-worker-env <<: *shared-api-worker-env
# Startup mode, 'worker' starts the Celery worker for processing the queue. # Startup mode, 'worker' starts the Celery worker for processing the queue.
MODE: worker MODE: worker
depends_on: depends_on:
- db db:
- redis condition: service_healthy
redis:
condition: service_healthy
volumes: volumes:
# Mount the storage directory to the container, for storing user files. # Mount the storage directory to the container, for storing user files.
- './volumes/app/storage:/app/api/storage' - dify-storage:/app/api/storage
networks: networks:
- ssrf_proxy_network - ssrf_proxy_network
- default - default
@@ -208,12 +208,12 @@ services:
# Frontend web application. # Frontend web application.
web: web:
image: langgenius/dify-web:latest image: langgenius/dify-web:latest
restart: always
environment: environment:
CONSOLE_API_URL: ${CONSOLE_API_URL:-} - SERVICE_FQDN_WEB_3000
APP_API_URL: ${APP_API_URL:-} - CONSOLE_API_URL=${SERVICE_FQDN_WEB}
SENTRY_DSN: ${WEB_SENTRY_DSN:-} - APP_API_URL=${SERVICE_FQDN_API}
NEXT_TELEMETRY_DISABLED: ${NEXT_TELEMETRY_DISABLED:-0} - SENTRY_DSN=${WEB_SENTRY_DSN:-}
- NEXT_TELEMETRY_DISABLED=${NEXT_TELEMETRY_DISABLED:-0}
healthcheck: healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://web:3000"] test: ["CMD", "wget", "--spider", "-q", "http://web:3000"]
interval: 30s interval: 30s
@@ -224,7 +224,6 @@ services:
# The postgres database. # The postgres database.
db: db:
image: postgres:15-alpine image: postgres:15-alpine
restart: always
environment: environment:
POSTGRES_USER: $SERVICE_USER_POSTGRES POSTGRES_USER: $SERVICE_USER_POSTGRES
POSTGRES_PASSWORD: $SERVICE_PASSWORD_POSTGRES POSTGRES_PASSWORD: $SERVICE_PASSWORD_POSTGRES
@@ -237,7 +236,7 @@ services:
-c 'maintenance_work_mem=${POSTGRES_MAINTENANCE_WORK_MEM:-64MB}' -c 'maintenance_work_mem=${POSTGRES_MAINTENANCE_WORK_MEM:-64MB}'
-c 'effective_cache_size=${POSTGRES_EFFECTIVE_CACHE_SIZE:-4096MB}' -c 'effective_cache_size=${POSTGRES_EFFECTIVE_CACHE_SIZE:-4096MB}'
volumes: volumes:
- './volumes/db/data:/var/lib/postgresql/data' - dify-db-data:/var/lib/postgresql/data
healthcheck: healthcheck:
test: ["CMD", "pg_isready", "-U", "$SERVICE_USER_POSTGRES", "-d", "dify"] test: ["CMD", "pg_isready", "-U", "$SERVICE_USER_POSTGRES", "-d", "dify"]
interval: 10s interval: 10s
@@ -247,10 +246,10 @@ services:
# The redis cache. # The redis cache.
redis: redis:
image: redis:6-alpine image: redis:6-alpine
restart: always environment:
REDIS_PASSWORD: $SERVICE_PASSWORD_REDIS
volumes: volumes:
# Mount the redis data directory to the container. - dify-redis-data:/data
- './volumes/redis/data:/data'
# Set the redis password when startup redis server. # Set the redis password when startup redis server.
command: redis-server --requirepass "$SERVICE_PASSWORD_REDIS" command: redis-server --requirepass "$SERVICE_PASSWORD_REDIS"
healthcheck: healthcheck:
@@ -276,13 +275,17 @@ services:
networks: networks:
- ssrf_proxy_network - ssrf_proxy_network
- default - default
healthcheck:
test: ["CMD-SHELL", "bash -c ':> /dev/tcp/127.0.0.1/8194' || exit 1"]
interval: 5s
timeout: 20s
retries: 3
# ssrf_proxy server # ssrf_proxy server
# for more information, please refer to # for more information, please refer to
# https://docs.dify.ai/learn-more/faq/self-host-faq#id-18.-why-is-ssrf_proxy-needed # https://docs.dify.ai/learn-more/faq/self-host-faq#id-18.-why-is-ssrf_proxy-needed
ssrf_proxy: ssrf_proxy:
image: ubuntu/squid:latest image: ubuntu/squid:latest
restart: always
volumes: volumes:
- type: bind - type: bind
source: ./ssrf_proxy/squid.conf.template source: ./ssrf_proxy/squid.conf.template
@@ -410,7 +413,6 @@ services:
# used for reverse proxying the API service and Web service. # used for reverse proxying the API service and Web service.
nginx: nginx:
image: nginx:latest image: nginx:latest
restart: always
volumes: volumes:
- type: bind - type: bind
source: ./nginx/nginx.conf.template source: ./nginx/nginx.conf.template
@@ -604,10 +606,8 @@ services:
profiles: profiles:
- '' - ''
- weaviate - weaviate
restart: always
volumes: volumes:
# Mount the Weaviate data directory to the con tainer. - dify-weaviate-data:/var/lib/weaviate
- ./volumes/weaviate:/var/lib/weaviate
environment: environment:
# The Weaviate configurations # The Weaviate configurations
# You can refer to the [Weaviate](https://weaviate.io/developers/weaviate/config-refs/env-vars) documentation for more information. # You can refer to the [Weaviate](https://weaviate.io/developers/weaviate/config-refs/env-vars) documentation for more information.