From bdd32418fdf73d8945b14fd2e595b46e2a57dfce Mon Sep 17 00:00:00 2001 From: warjiang <1096409085@qq.com> Date: Thu, 15 May 2025 00:24:30 +0800 Subject: [PATCH] feat: add support for private registry --- docker/.env.example | 3 ++ docker/docker-compose.yaml | 57 +++++++++++++++++++------------------- 2 files changed, 32 insertions(+), 28 deletions(-) diff --git a/docker/.env.example b/docker/.env.example index 37738a5065..89cf00dc16 100644 --- a/docker/.env.example +++ b/docker/.env.example @@ -1093,3 +1093,6 @@ OTEL_METRIC_EXPORT_TIMEOUT=30000 # Prevent Clickjacking ALLOW_EMBED=false + +# private docker registry +#REGISTRY={your private registry} diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 1b9ae75c51..bc09851e54 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -492,7 +492,7 @@ x-shared-env: &shared-api-worker-env services: # API service api: - image: langgenius/dify-api:1.3.1 + image: "${REGISTRY:-docker.io}/langgenius/dify-api:1.3.1" restart: always environment: # Use the shared environment variables. @@ -521,7 +521,7 @@ services: # worker service # The Celery worker for processing the queue. worker: - image: langgenius/dify-api:1.3.1 + image: "${REGISTRY:-docker.io}/langgenius/dify-api:1.3.1" restart: always environment: # Use the shared environment variables. @@ -547,7 +547,7 @@ services: # Frontend web application. web: - image: langgenius/dify-web:1.3.1 + image: "${REGISTRY:-docker.io}/langgenius/dify-web:1.3.1" restart: always environment: CONSOLE_API_URL: ${CONSOLE_API_URL:-} @@ -571,7 +571,7 @@ services: ENABLE_WEBSITE_WATERCRAWL: ${ENABLE_WEBSITE_WATERCRAWL:-true} # The postgres database. db: - image: postgres:15-alpine + image: "${REGISTRY:-docker.io}/postgres:15-alpine" restart: always environment: PGUSER: ${PGUSER:-postgres} @@ -594,7 +594,7 @@ services: # The redis cache. redis: - image: redis:6-alpine + image: "${REGISTRY:-docker.io}/redis:6-alpine" restart: always environment: REDISCLI_AUTH: ${REDIS_PASSWORD:-difyai123456} @@ -608,7 +608,7 @@ services: # The DifySandbox sandbox: - image: langgenius/dify-sandbox:0.2.11 + image: "${REGISTRY:-docker.io}/langgenius/dify-sandbox:0.2.11" restart: always environment: # The DifySandbox configurations @@ -632,7 +632,7 @@ services: # plugin daemon plugin_daemon: - image: langgenius/dify-plugin-daemon:0.0.9-local + image: "${REGISTRY:-docker.io}/langgenius/dify-plugin-daemon:0.0.9-local" restart: always environment: # Use the shared environment variables. @@ -680,7 +680,7 @@ services: # for more information, please refer to # https://docs.dify.ai/learn-more/faq/install-faq#18-why-is-ssrf-proxy-needed%3F ssrf_proxy: - image: ubuntu/squid:latest + image: "${REGISTRY:-docker.io}/ubuntu/squid:latest" restart: always volumes: - ./ssrf_proxy/squid.conf.template:/etc/squid/squid.conf.template @@ -700,7 +700,7 @@ services: # Certbot service # use `docker-compose --profile certbot up` to start the certbot service. certbot: - image: certbot/certbot + image: "${REGISTRY:-docker.io}/certbot/certbot" profiles: - certbot volumes: @@ -720,7 +720,7 @@ services: # The nginx reverse proxy. # used for reverse proxying the API service and Web service. nginx: - image: nginx:latest + image: "${REGISTRY:-docker.io}/nginx:latest" restart: always volumes: - ./nginx/nginx.conf.template:/etc/nginx/nginx.conf.template @@ -759,7 +759,7 @@ services: # The Weaviate vector store. weaviate: - image: semitechnologies/weaviate:1.19.0 + image: "${REGISTRY:-docker.io}/semitechnologies/weaviate:1.19.0" profiles: - '' - weaviate @@ -784,7 +784,7 @@ services: # Qdrant vector store. # (if used, you need to set VECTOR_STORE to qdrant in the api & worker service.) qdrant: - image: langgenius/qdrant:v1.7.3 + image: "${REGISTRY:-docker.io}/langgenius/qdrant:v1.7.3" profiles: - qdrant restart: always @@ -828,7 +828,7 @@ services: # The pgvector vector database. pgvector: - image: pgvector/pgvector:pg16 + image: "${REGISTRY:-docker.io}/pgvector/pgvector:pg16" profiles: - pgvector restart: always @@ -855,7 +855,7 @@ services: # get image from https://www.vastdata.com.cn/ vastbase: - image: vastdata/vastbase-vector + image: "${REGISTRY:-docker.io}/vastdata/vastbase-vector" profiles: - vastbase restart: always @@ -879,7 +879,7 @@ services: # pgvecto-rs vector store pgvecto-rs: - image: tensorchord/pgvecto-rs:pg16-v0.3.0 + image: "${REGISTRY:-docker.io}/tensorchord/pgvecto-rs:pg16-v0.3.0" profiles: - pgvecto-rs restart: always @@ -901,7 +901,8 @@ services: # Chroma vector database chroma: - image: ghcr.io/chroma-core/chroma:0.5.20 + # image: ghcr.io/chroma-core/chroma:0.5.20 + image: "${REGISTRY:-ghcr.io}/chroma-core/chroma:0.5.20" profiles: - chroma restart: always @@ -914,7 +915,7 @@ services: # OceanBase vector database oceanbase: - image: oceanbase/oceanbase-ce:4.3.5.1-101000042025031818 + image: "${REGISTRY:-docker.io}/oceanbase/oceanbase-ce:4.3.5.1-101000042025031818" container_name: oceanbase profiles: - oceanbase @@ -934,7 +935,7 @@ services: # Oracle vector database oracle: - image: container-registry.oracle.com/database/free:latest + image: "${REGISTRY:-container-registry.oracle.com}/database/free:latest" profiles: - oracle restart: always @@ -950,7 +951,7 @@ services: # Milvus vector database services etcd: container_name: milvus-etcd - image: quay.io/coreos/etcd:v3.5.5 + image: "${REGISTRY:-quay.io}/coreos/etcd:v3.5.5" profiles: - milvus environment: @@ -971,7 +972,7 @@ services: minio: container_name: milvus-minio - image: minio/minio:RELEASE.2023-03-20T20-16-18Z + image: "${REGISTRY:-docker.io}/minio/minio:RELEASE.2023-03-20T20-16-18Z" profiles: - milvus environment: @@ -990,7 +991,7 @@ services: milvus-standalone: container_name: milvus-standalone - image: milvusdb/milvus:v2.5.0-beta + image: "${REGISTRY:-docker.io}/milvusdb/milvus:v2.5.0-beta" profiles: - milvus command: [ 'milvus', 'run', 'standalone' ] @@ -1018,7 +1019,7 @@ services: # Opensearch vector database opensearch: container_name: opensearch - image: opensearchproject/opensearch:latest + image: "${REGISTRY:-docker.io}/opensearchproject/opensearch:latest" profiles: - opensearch environment: @@ -1040,7 +1041,7 @@ services: opensearch-dashboards: container_name: opensearch-dashboards - image: opensearchproject/opensearch-dashboards:latest + image: "${REGISTRY:-docker.io}/opensearchproject/opensearch-dashboards:latest" profiles: - opensearch environment: @@ -1054,7 +1055,7 @@ services: # opengauss vector database. opengauss: - image: opengauss/opengauss:7.0.0-RC1 + image: "${REGISTRY:-docker.io}/opengauss/opengauss:7.0.0-RC1" profiles: - opengauss privileged: true @@ -1077,7 +1078,7 @@ services: # MyScale vector database myscale: container_name: myscale - image: myscale/myscaledb:1.6.4 + image: "${REGISTRY:-docker.io}/myscale/myscaledb:1.6.4" profiles: - myscale restart: always @@ -1092,7 +1093,7 @@ services: # https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html # https://www.elastic.co/guide/en/elasticsearch/reference/current/docker.html#docker-prod-prerequisites elasticsearch: - image: docker.elastic.co/elasticsearch/elasticsearch:8.14.3 + image: "${REGISTRY:-docker.elastic.co}/elasticsearch/elasticsearch:8.14.3" container_name: elasticsearch profiles: - elasticsearch @@ -1127,7 +1128,7 @@ services: # https://www.elastic.co/guide/en/kibana/current/docker.html # https://www.elastic.co/guide/en/kibana/current/settings.html kibana: - image: docker.elastic.co/kibana/kibana:8.14.3 + image: "${REGISTRY:-docker.elastic.co}/kibana/kibana:8.14.3" container_name: kibana profiles: - elasticsearch @@ -1155,7 +1156,7 @@ services: # unstructured . # (if used, you need to set ETL_TYPE to Unstructured in the api & worker service.) unstructured: - image: downloads.unstructured.io/unstructured-io/unstructured-api:latest + image: "${REGISTRY:-downloads.unstructured.io}/unstructured-io/unstructured-api:latest" profiles: - unstructured restart: always