feat(ci): 1. remove docker proxy. 2. split debug and docker environment (#304)
This commit is contained in:
parent
7ff025eef5
commit
357da72a52
|
|
@ -6,6 +6,7 @@
|
||||||
*.dylib
|
*.dylib
|
||||||
|
|
||||||
.env
|
.env
|
||||||
|
.env.debug
|
||||||
|
|
||||||
# Test binary, built with `go test -c`
|
# Test binary, built with `go test -c`
|
||||||
*.test
|
*.test
|
||||||
|
|
@ -52,5 +53,8 @@ common/temp
|
||||||
|
|
||||||
|
|
||||||
backend/conf/model/*.yaml
|
backend/conf/model/*.yaml
|
||||||
|
values-dev.yaml
|
||||||
|
**/conf/model_ark_doubao-seed-1.6.yaml
|
||||||
|
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
|
|
|
||||||
8
Makefile
8
Makefile
|
|
@ -8,10 +8,10 @@ SYNC_DB_SCRIPT := $(SCRIPTS_DIR)/setup/db_migrate_apply.sh
|
||||||
DUMP_DB_SCRIPT := $(SCRIPTS_DIR)/setup/db_migrate_dump.sh
|
DUMP_DB_SCRIPT := $(SCRIPTS_DIR)/setup/db_migrate_dump.sh
|
||||||
SETUP_DOCKER_SCRIPT := $(SCRIPTS_DIR)/setup/docker.sh
|
SETUP_DOCKER_SCRIPT := $(SCRIPTS_DIR)/setup/docker.sh
|
||||||
SETUP_PYTHON_SCRIPT := $(SCRIPTS_DIR)/setup/python.sh
|
SETUP_PYTHON_SCRIPT := $(SCRIPTS_DIR)/setup/python.sh
|
||||||
COMPOSE_FILE := docker/docker-compose.yml
|
COMPOSE_FILE := docker/docker-compose-debug.yml
|
||||||
MYSQL_SCHEMA := ./docker/volumes/mysql/schema.sql
|
MYSQL_SCHEMA := ./docker/volumes/mysql/schema.sql
|
||||||
MYSQL_INIT_SQL := ./docker/volumes/mysql/sql_init.sql
|
MYSQL_INIT_SQL := ./docker/volumes/mysql/sql_init.sql
|
||||||
ENV_FILE := ./docker/.env
|
ENV_FILE := ./docker/.env.debug
|
||||||
STATIC_DIR := ./bin/resources/static
|
STATIC_DIR := ./bin/resources/static
|
||||||
ES_INDEX_SCHEMA := ./docker/volumes/elasticsearch/es_index_schema
|
ES_INDEX_SCHEMA := ./docker/volumes/elasticsearch/es_index_schema
|
||||||
ES_SETUP_SCRIPT := ./docker/volumes/elasticsearch/setup_es.sh
|
ES_SETUP_SCRIPT := ./docker/volumes/elasticsearch/setup_es.sh
|
||||||
|
|
@ -34,7 +34,7 @@ server: env setup_es_index
|
||||||
$(MAKE) fe; \
|
$(MAKE) fe; \
|
||||||
fi
|
fi
|
||||||
@echo "Building and run server..."
|
@echo "Building and run server..."
|
||||||
@bash $(BUILD_SERVER_SCRIPT) -start
|
@APP_ENV=debug bash $(BUILD_SERVER_SCRIPT) -start
|
||||||
|
|
||||||
build_server:
|
build_server:
|
||||||
@echo "Building server..."
|
@echo "Building server..."
|
||||||
|
|
@ -59,7 +59,7 @@ middleware:
|
||||||
|
|
||||||
web:
|
web:
|
||||||
@echo "Start web server in docker"
|
@echo "Start web server in docker"
|
||||||
@docker compose -f $(COMPOSE_FILE) --env-file $(ENV_FILE) --profile '*' up -d --wait
|
@docker compose -f docker/docker-compose.yml up -d
|
||||||
|
|
||||||
down:
|
down:
|
||||||
@echo "Stop all docker containers"
|
@echo "Stop all docker containers"
|
||||||
|
|
|
||||||
|
|
@ -10,12 +10,6 @@ RUN apk add --no-cache git gcc libc-dev
|
||||||
COPY backend/go.mod backend/go.sum ./
|
COPY backend/go.mod backend/go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
|
|
||||||
COPY docker/proxy ./proxy
|
|
||||||
|
|
||||||
# Build the proxy application
|
|
||||||
RUN go build -ldflags="-s -w" -o /app/proxy_app ./proxy/proxy.go
|
|
||||||
|
|
||||||
# Copy the entire backend source code
|
# Copy the entire backend source code
|
||||||
COPY backend/ ./
|
COPY backend/ ./
|
||||||
|
|
||||||
|
|
@ -50,7 +44,6 @@ RUN apk add --no-cache --virtual .python-build-deps build-base py3-pip git && \
|
||||||
|
|
||||||
# Copy the built Go binary from the builder stage
|
# Copy the built Go binary from the builder stage
|
||||||
COPY --from=builder /app/opencoze /app/opencoze
|
COPY --from=builder /app/opencoze /app/opencoze
|
||||||
COPY --from=builder /app/proxy_app /app/proxy
|
|
||||||
|
|
||||||
# Copy Python application scripts
|
# Copy Python application scripts
|
||||||
COPY backend/infra/impl/document/parser/builtin/parse_pdf.py /app/parse_pdf.py
|
COPY backend/infra/impl/document/parser/builtin/parse_pdf.py /app/parse_pdf.py
|
||||||
|
|
@ -74,8 +67,6 @@ ENV PATH="/app/.venv/bin:${PATH}"
|
||||||
RUN chmod +x /app/parse_pdf.py /app/parse_docx.py && \
|
RUN chmod +x /app/parse_pdf.py /app/parse_docx.py && \
|
||||||
find /app/.venv/bin -type f -exec chmod +x {} \;
|
find /app/.venv/bin -type f -exec chmod +x {} \;
|
||||||
|
|
||||||
# Ensure Go binaries are executable
|
|
||||||
RUN chmod +x /app/opencoze /app/proxy
|
|
||||||
|
|
||||||
EXPOSE 8888
|
EXPOSE 8888
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,11 @@ import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
|
|
||||||
"github.com/getkin/kin-openapi/openapi3"
|
"github.com/getkin/kin-openapi/openapi3"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
"github.com/coze-dev/coze-studio/backend/api/model/crossdomain/plugin"
|
||||||
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common"
|
common "github.com/coze-dev/coze-studio/backend/api/model/plugin_develop_common"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/domain/plugin/entity"
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
|
"github.com/coze-dev/coze-studio/backend/pkg/errorx"
|
||||||
"github.com/coze-dev/coze-studio/backend/types/errno"
|
"github.com/coze-dev/coze-studio/backend/types/errno"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,9 @@ import (
|
||||||
"github.com/cloudwego/eino-ext/components/model/ollama"
|
"github.com/cloudwego/eino-ext/components/model/ollama"
|
||||||
mo "github.com/cloudwego/eino-ext/components/model/openai"
|
mo "github.com/cloudwego/eino-ext/components/model/openai"
|
||||||
"github.com/cloudwego/eino-ext/components/model/qwen"
|
"github.com/cloudwego/eino-ext/components/model/qwen"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/chatmodel"
|
|
||||||
"google.golang.org/genai"
|
"google.golang.org/genai"
|
||||||
|
|
||||||
|
"github.com/coze-dev/coze-studio/backend/infra/contract/chatmodel"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetBuiltinChatModel(ctx context.Context, envPrefix string) (bcm chatmodel.BaseChatModel, configured bool, err error) {
|
func GetBuiltinChatModel(ctx context.Context, envPrefix string) (bcm chatmodel.BaseChatModel, configured bool, err error) {
|
||||||
|
|
|
||||||
|
|
@ -30,13 +30,12 @@ import (
|
||||||
"github.com/cloudwego/eino-ext/components/embedding/openai"
|
"github.com/cloudwego/eino-ext/components/embedding/openai"
|
||||||
"github.com/cloudwego/eino/components/prompt"
|
"github.com/cloudwego/eino/components/prompt"
|
||||||
"github.com/cloudwego/eino/schema"
|
"github.com/cloudwego/eino/schema"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/internal"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/embedding/http"
|
|
||||||
"github.com/milvus-io/milvus/client/v2/milvusclient"
|
"github.com/milvus-io/milvus/client/v2/milvusclient"
|
||||||
"github.com/volcengine/volc-sdk-golang/service/vikingdb"
|
"github.com/volcengine/volc-sdk-golang/service/vikingdb"
|
||||||
"github.com/volcengine/volc-sdk-golang/service/visual"
|
"github.com/volcengine/volc-sdk-golang/service/visual"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
|
"github.com/coze-dev/coze-studio/backend/application/internal"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/search"
|
"github.com/coze-dev/coze-studio/backend/application/search"
|
||||||
knowledgeImpl "github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
|
knowledgeImpl "github.com/coze-dev/coze-studio/backend/domain/knowledge/service"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/cache"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/cache"
|
||||||
|
|
@ -59,6 +58,7 @@ import (
|
||||||
ssmilvus "github.com/coze-dev/coze-studio/backend/infra/impl/document/searchstore/milvus"
|
ssmilvus "github.com/coze-dev/coze-studio/backend/infra/impl/document/searchstore/milvus"
|
||||||
ssvikingdb "github.com/coze-dev/coze-studio/backend/infra/impl/document/searchstore/vikingdb"
|
ssvikingdb "github.com/coze-dev/coze-studio/backend/infra/impl/document/searchstore/vikingdb"
|
||||||
arkemb "github.com/coze-dev/coze-studio/backend/infra/impl/embedding/ark"
|
arkemb "github.com/coze-dev/coze-studio/backend/infra/impl/embedding/ark"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/infra/impl/embedding/http"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/embedding/wrap"
|
"github.com/coze-dev/coze-studio/backend/infra/impl/embedding/wrap"
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/impl/eventbus"
|
"github.com/coze-dev/coze-studio/backend/infra/impl/eventbus"
|
||||||
builtinM2Q "github.com/coze-dev/coze-studio/backend/infra/impl/messages2query/builtin"
|
builtinM2Q "github.com/coze-dev/coze-studio/backend/infra/impl/messages2query/builtin"
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,12 @@ import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/cloudwego/eino/compose"
|
"github.com/cloudwego/eino/compose"
|
||||||
"github.com/coze-dev/coze-studio/backend/application/internal"
|
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/logs"
|
|
||||||
"github.com/redis/go-redis/v9"
|
"github.com/redis/go-redis/v9"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
|
|
||||||
|
"github.com/coze-dev/coze-studio/backend/application/internal"
|
||||||
|
"github.com/coze-dev/coze-studio/backend/pkg/logs"
|
||||||
|
|
||||||
wfdatabase "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/database"
|
wfdatabase "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/database"
|
||||||
wfknowledge "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/knowledge"
|
wfknowledge "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/knowledge"
|
||||||
wfmodel "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/model"
|
wfmodel "github.com/coze-dev/coze-studio/backend/crossdomain/workflow/model"
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,10 @@ type Client = redis.Client
|
||||||
|
|
||||||
func New() *redis.Client {
|
func New() *redis.Client {
|
||||||
addr := os.Getenv("REDIS_ADDR")
|
addr := os.Getenv("REDIS_ADDR")
|
||||||
password := os.Getenv("REDIS_PASSWORD")
|
password := os.Getenv("REDIS_PASSWORD")
|
||||||
rdb := redis.NewClient(&redis.Options{
|
rdb := redis.NewClient(&redis.Options{
|
||||||
Addr: addr, // Redis地址
|
Addr: addr, // Redis地址
|
||||||
DB: 0, // 默认数据库
|
DB: 0, // 默认数据库
|
||||||
Password: password,
|
Password: password,
|
||||||
// 连接池配置
|
// 连接池配置
|
||||||
PoolSize: 100, // 最大连接数(建议设置为CPU核心数*10)
|
PoolSize: 100, // 最大连接数(建议设置为CPU核心数*10)
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import (
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
opt "github.com/cloudwego/eino/components/embedding"
|
opt "github.com/cloudwego/eino/components/embedding"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/pkg/lang/slices"
|
"github.com/coze-dev/coze-studio/backend/pkg/lang/slices"
|
||||||
|
|
||||||
"github.com/coze-dev/coze-studio/backend/infra/contract/embedding"
|
"github.com/coze-dev/coze-studio/backend/infra/contract/embedding"
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,11 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "Bootstrapping Coze Studio... 07-30"
|
||||||
|
|
||||||
# Set up Elasticsearch
|
# Set up Elasticsearch
|
||||||
echo "Setting up Elasticsearch..."
|
echo "Setting up Elasticsearch..."
|
||||||
/app/setup_es.sh --index-dir /app/es_index_schemas
|
/app/setup_es.sh --index-dir /app/es_index_schemas
|
||||||
|
|
||||||
# Start the proxy application in the background
|
|
||||||
echo "Starting proxy application..."
|
|
||||||
/app/proxy >/tmp/proxy.log 2>&1 &
|
|
||||||
echo "Proxy application started in background."
|
|
||||||
|
|
||||||
# Start the main application in the foreground
|
# Start the main application in the foreground
|
||||||
echo "Starting main application..."
|
echo "Starting main application..."
|
||||||
/app/opencoze
|
/app/opencoze
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ export MYSQL_ROOT_PASSWORD=root
|
||||||
export MYSQL_DATABASE=opencoze
|
export MYSQL_DATABASE=opencoze
|
||||||
export MYSQL_USER=coze
|
export MYSQL_USER=coze
|
||||||
export MYSQL_PASSWORD=coze123
|
export MYSQL_PASSWORD=coze123
|
||||||
export MYSQL_HOST=localhost
|
export MYSQL_HOST=coze-mysql
|
||||||
export MYSQL_PORT=3306
|
export MYSQL_PORT=3306
|
||||||
export MYSQL_DSN="${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(${MYSQL_HOST}:${MYSQL_PORT})/${MYSQL_DATABASE}?charset=utf8mb4&parseTime=True"
|
export MYSQL_DSN="${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(${MYSQL_HOST}:${MYSQL_PORT})/${MYSQL_DATABASE}?charset=utf8mb4&parseTime=True"
|
||||||
export ATLAS_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?charset=utf8mb4&parseTime=True"
|
export ATLAS_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?charset=utf8mb4&parseTime=True"
|
||||||
|
|
@ -22,7 +22,7 @@ export ATLAS_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@${MYSQL_HOST}:${MYSQL_
|
||||||
export REDIS_AOF_ENABLED=no
|
export REDIS_AOF_ENABLED=no
|
||||||
export REDIS_IO_THREADS=4
|
export REDIS_IO_THREADS=4
|
||||||
export ALLOW_EMPTY_PASSWORD=yes
|
export ALLOW_EMPTY_PASSWORD=yes
|
||||||
export REDIS_ADDR="localhost:6379"
|
export REDIS_ADDR="coze-redis:6379"
|
||||||
export REDIS_PASSWORD=""
|
export REDIS_PASSWORD=""
|
||||||
|
|
||||||
# This Upload component used in Agent / workflow File/Image With LLM , support the component of imagex / storage
|
# This Upload component used in Agent / workflow File/Image With LLM , support the component of imagex / storage
|
||||||
|
|
@ -47,7 +47,7 @@ export MINIO_ROOT_PASSWORD=minioadmin123
|
||||||
export MINIO_DEFAULT_BUCKETS=milvus
|
export MINIO_DEFAULT_BUCKETS=milvus
|
||||||
export MINIO_AK=$MINIO_ROOT_USER
|
export MINIO_AK=$MINIO_ROOT_USER
|
||||||
export MINIO_SK=$MINIO_ROOT_PASSWORD
|
export MINIO_SK=$MINIO_ROOT_PASSWORD
|
||||||
export MINIO_ENDPOINT="localhost:9000"
|
export MINIO_ENDPOINT="coze-minio:9000"
|
||||||
export MINIO_API_HOST="http://${MINIO_ENDPOINT}"
|
export MINIO_API_HOST="http://${MINIO_ENDPOINT}"
|
||||||
|
|
||||||
# TOS
|
# TOS
|
||||||
|
|
@ -65,14 +65,14 @@ export S3_BUCKET_ENDPOINT=
|
||||||
export S3_REGION=
|
export S3_REGION=
|
||||||
|
|
||||||
# Elasticsearch
|
# Elasticsearch
|
||||||
export ES_ADDR="http://localhost:9200"
|
export ES_ADDR="http://coze-elasticsearch:9200"
|
||||||
export ES_VERSION="v8"
|
export ES_VERSION="v8"
|
||||||
export ES_USERNAME=""
|
export ES_USERNAME=""
|
||||||
export ES_PASSWORD=""
|
export ES_PASSWORD=""
|
||||||
|
|
||||||
|
|
||||||
export COZE_MQ_TYPE="nsq" # nsq / kafka / rmq
|
export COZE_MQ_TYPE="nsq" # nsq / kafka / rmq
|
||||||
export MQ_NAME_SERVER="127.0.0.1:4150"
|
export MQ_NAME_SERVER="coze-nsqd:4150"
|
||||||
# RocketMQ
|
# RocketMQ
|
||||||
export RMQ_ACCESS_KEY=""
|
export RMQ_ACCESS_KEY=""
|
||||||
export RMQ_SECRET_KEY=""
|
export RMQ_SECRET_KEY=""
|
||||||
|
|
@ -82,7 +82,7 @@ export RMQ_SECRET_KEY=""
|
||||||
# If you want to use vikingdb, you need to set up the vikingdb configuration.
|
# If you want to use vikingdb, you need to set up the vikingdb configuration.
|
||||||
export VECTOR_STORE_TYPE="milvus"
|
export VECTOR_STORE_TYPE="milvus"
|
||||||
# milvus vector store
|
# milvus vector store
|
||||||
export MILVUS_ADDR="localhost:19530"
|
export MILVUS_ADDR="coze-milvus:19530"
|
||||||
# vikingdb vector store for Volcengine
|
# vikingdb vector store for Volcengine
|
||||||
export VIKING_DB_HOST=""
|
export VIKING_DB_HOST=""
|
||||||
export VIKING_DB_REGION=""
|
export VIKING_DB_REGION=""
|
||||||
|
|
@ -119,7 +119,7 @@ export OLLAMA_EMBEDDING_MODEL=""
|
||||||
export OLLAMA_EMBEDDING_DIMS=""
|
export OLLAMA_EMBEDDING_DIMS=""
|
||||||
|
|
||||||
# http embedding
|
# http embedding
|
||||||
export HTTP_EMBEDDING_ADDR="http://127.0.0.1:6543"
|
export HTTP_EMBEDDING_ADDR=""
|
||||||
export HTTP_EMBEDDING_DIMS=1024
|
export HTTP_EMBEDDING_DIMS=1024
|
||||||
|
|
||||||
# Settings for OCR
|
# Settings for OCR
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,548 @@
|
||||||
|
x-env-file: &env_file
|
||||||
|
- .env.debug
|
||||||
|
|
||||||
|
services:
|
||||||
|
mysql:
|
||||||
|
image: mysql:8.4.5
|
||||||
|
container_name: coze-mysql
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root}
|
||||||
|
MYSQL_DATABASE: ${MYSQL_DATABASE:-opencoze}
|
||||||
|
MYSQL_USER: ${MYSQL_USER:-coze}
|
||||||
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-coze123}
|
||||||
|
profiles: ['middleware', 'mysql-setup', 'mysql']
|
||||||
|
env_file: *env_file
|
||||||
|
ports:
|
||||||
|
- '3306:3306'
|
||||||
|
volumes:
|
||||||
|
- ./data/mysql:/var/lib/mysql
|
||||||
|
command:
|
||||||
|
- --character-set-server=utf8mb4
|
||||||
|
- --collation-server=utf8mb4_unicode_ci
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
[
|
||||||
|
'CMD',
|
||||||
|
'mysqladmin',
|
||||||
|
'ping',
|
||||||
|
'-h',
|
||||||
|
'localhost',
|
||||||
|
'-u$${MYSQL_USER}',
|
||||||
|
'-p$${MYSQL_PASSWORD}',
|
||||||
|
]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
start_period: 30s
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: bitnami/redis:8.0
|
||||||
|
container_name: coze-redis
|
||||||
|
user: root
|
||||||
|
privileged: true
|
||||||
|
profiles: ['middleware']
|
||||||
|
env_file: *env_file
|
||||||
|
environment:
|
||||||
|
- REDIS_AOF_ENABLED=${REDIS_AOF_ENABLED:-no}
|
||||||
|
- REDIS_PORT_NUMBER=${REDIS_PORT_NUMBER:-6379}
|
||||||
|
- REDIS_IO_THREADS=${REDIS_IO_THREADS:-4}
|
||||||
|
- ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD:-yes}
|
||||||
|
ports:
|
||||||
|
- '6379:6379'
|
||||||
|
volumes:
|
||||||
|
- ./data/bitnami/redis:/bitnami/redis/data:rw,Z
|
||||||
|
command: >
|
||||||
|
bash -c "
|
||||||
|
/opt/bitnami/scripts/redis/setup.sh
|
||||||
|
# Set proper permissions for data directories
|
||||||
|
chown -R redis:redis /bitnami/redis/data
|
||||||
|
chmod g+s /bitnami/redis/data
|
||||||
|
|
||||||
|
exec /opt/bitnami/scripts/redis/entrypoint.sh /opt/bitnami/scripts/redis/run.sh
|
||||||
|
"
|
||||||
|
depends_on:
|
||||||
|
minio-setup:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
mysql-setup-schema:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
mysql-setup-init-sql:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'redis-cli', 'ping']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 10s
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
|
||||||
|
# rocketmq-namesrv:
|
||||||
|
# image: apache/rocketmq:5.3.2
|
||||||
|
# container_name: coze-rocketmq-namesrv
|
||||||
|
# privileged: true
|
||||||
|
# user: root
|
||||||
|
# profiles: ['middleware']
|
||||||
|
# env_file: *env_file
|
||||||
|
# ports:
|
||||||
|
# - '9876:9876'
|
||||||
|
# volumes:
|
||||||
|
# - ./data/rocketmq/namesrv/logs:/home/rocketmq/logs:rw,Z
|
||||||
|
# - ./data/rocketmq/namesrv/store:/home/rocketmq/store:rw,Z
|
||||||
|
# environment:
|
||||||
|
# - ALLOW_ANONYMOUS_LOGIN=yes
|
||||||
|
# command: >
|
||||||
|
# bash -c "
|
||||||
|
# # Set proper permissions for data directories
|
||||||
|
# mkdir -p /home/rocketmq/logs /home/rocketmq/store
|
||||||
|
# mkdir -p /home/rocketmq/logs/rocketmqlogs
|
||||||
|
# touch /home/rocketmq/logs/rocketmqlogs/tools.log
|
||||||
|
# touch /home/rocketmq/logs/rocketmqlogs/tools_default.log
|
||||||
|
|
||||||
|
# chown -R rocketmq:rocketmq /home/rocketmq/logs /home/rocketmq/store
|
||||||
|
# chmod g+s /home/rocketmq/logs /home/rocketmq/store
|
||||||
|
|
||||||
|
# echo 'Starting RocketMQ NameServer...'
|
||||||
|
# sh mqnamesrv
|
||||||
|
# "
|
||||||
|
# healthcheck:
|
||||||
|
# test: ['CMD', 'sh', 'mqadmin', 'clusterList', '-n', 'localhost:9876']
|
||||||
|
# interval: 5s
|
||||||
|
# timeout: 10s
|
||||||
|
# retries: 10
|
||||||
|
# start_period: 10s
|
||||||
|
# networks:
|
||||||
|
# - coze-network
|
||||||
|
# rocketmq-broker:
|
||||||
|
# image: apache/rocketmq:5.3.2
|
||||||
|
# container_name: coze-rocketmq-broker
|
||||||
|
# privileged: true
|
||||||
|
# user: root
|
||||||
|
# profiles: ['middleware']
|
||||||
|
# env_file: *env_file
|
||||||
|
# ports:
|
||||||
|
# - '10909:10909'
|
||||||
|
# - '10911:10911'
|
||||||
|
# - '10912:10912'
|
||||||
|
# volumes:
|
||||||
|
# - ./data/rocketmq/broker/logs:/home/rocketmq/logs:rw,Z
|
||||||
|
# - ./data/rocketmq/broker/store:/home/rocketmq/store:rw,Z
|
||||||
|
# - ./volumes/rocketmq/broker.conf:/home/rocketmq/conf/broker.conf:rw,Z
|
||||||
|
# networks:
|
||||||
|
# - coze-network
|
||||||
|
# command: >
|
||||||
|
# bash -c '
|
||||||
|
# # Set proper permissions
|
||||||
|
# mkdir -p /home/rocketmq/logs/rocketmqlogs /home/rocketmq/store
|
||||||
|
# touch /home/rocketmq/logs/rocketmqlogs/tools.log \
|
||||||
|
# /home/rocketmq/logs/rocketmqlogs/tools_default.log
|
||||||
|
# chown -R rocketmq:rocketmq /home/rocketmq/logs /home/rocketmq/store
|
||||||
|
# chmod g+s /home/rocketmq/logs /home/rocketmq/store
|
||||||
|
|
||||||
|
# echo "Starting RocketMQ Broker..."
|
||||||
|
# sh mqbroker -n rocketmq-namesrv:9876 -c /home/rocketmq/conf/broker.conf &
|
||||||
|
|
||||||
|
# echo "Waiting for Broker registration..."
|
||||||
|
# broker_ready=false
|
||||||
|
# for i in {1..60}; do
|
||||||
|
# if sh mqadmin clusterList -n rocketmq-namesrv:9876 \
|
||||||
|
# | grep -q "DefaultCluster.*broker-a"; then
|
||||||
|
# echo "Registered."
|
||||||
|
# broker_ready=true
|
||||||
|
# break
|
||||||
|
# fi
|
||||||
|
# echo "Not ready, retry $$i/60..."
|
||||||
|
# sleep 1
|
||||||
|
# done
|
||||||
|
|
||||||
|
# if [ "$$broker_ready" = false ]; then
|
||||||
|
# echo "ERROR: registration timed out."
|
||||||
|
# exit 1
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# echo "Creating topics..."
|
||||||
|
# for t in opencoze_knowledge opencoze_search_app opencoze_search_resource \
|
||||||
|
# %RETRY%cg_knowledge %RETRY%cg_search_app %RETRY%cg_search_resource; do
|
||||||
|
# sh mqadmin updateTopic -n rocketmq-namesrv:9876 \
|
||||||
|
# -c DefaultCluster -t "$$t"
|
||||||
|
# done
|
||||||
|
|
||||||
|
# touch /tmp/rocketmq_ready
|
||||||
|
# echo "Broker started successfully."
|
||||||
|
# wait
|
||||||
|
# '
|
||||||
|
# depends_on:
|
||||||
|
# - rocketmq-namesrv
|
||||||
|
# healthcheck:
|
||||||
|
# test: ['CMD-SHELL', '[ -f /tmp/rocketmq_ready ]']
|
||||||
|
# interval: 10s
|
||||||
|
# timeout: 10s
|
||||||
|
# retries: 10
|
||||||
|
# start_period: 10s
|
||||||
|
|
||||||
|
elasticsearch:
|
||||||
|
image: bitnami/elasticsearch:8.18.0
|
||||||
|
container_name: coze-elasticsearch
|
||||||
|
user: root
|
||||||
|
privileged: true
|
||||||
|
profiles: ['middleware']
|
||||||
|
env_file: *env_file
|
||||||
|
environment:
|
||||||
|
- TEST=1
|
||||||
|
# Add Java certificate trust configuration
|
||||||
|
# - ES_JAVA_OPTS=-Djdk.tls.client.protocols=TLSv1.2 -Dhttps.protocols=TLSv1.2 -Djavax.net.ssl.trustAll=true -Xms4096m -Xmx4096m
|
||||||
|
ports:
|
||||||
|
- '9200:9200'
|
||||||
|
volumes:
|
||||||
|
- ./data/bitnami/elasticsearch:/bitnami/elasticsearch/data
|
||||||
|
- ./volumes/elasticsearch/elasticsearch.yml:/opt/bitnami/elasticsearch/config/my_elasticsearch.yml
|
||||||
|
- ./volumes/elasticsearch/analysis-smartcn.zip:/opt/bitnami/elasticsearch/analysis-smartcn.zip:rw,Z
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
[
|
||||||
|
'CMD-SHELL',
|
||||||
|
'curl -f http://localhost:9200 && [ -f /tmp/es_plugins_ready ]',
|
||||||
|
]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 10s
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
# Install smartcn analyzer plugin
|
||||||
|
command: >
|
||||||
|
bash -c "
|
||||||
|
/opt/bitnami/scripts/elasticsearch/setup.sh
|
||||||
|
# Set proper permissions for data directories
|
||||||
|
chown -R elasticsearch:elasticsearch /bitnami/elasticsearch/data
|
||||||
|
chmod g+s /bitnami/elasticsearch/data
|
||||||
|
|
||||||
|
# Create plugin directory
|
||||||
|
mkdir -p /bitnami/elasticsearch/plugins;
|
||||||
|
|
||||||
|
# Unzip plugin to plugin directory and set correct permissions
|
||||||
|
echo 'Installing smartcn plugin...';
|
||||||
|
if [ ! -d /opt/bitnami/elasticsearch/plugins/analysis-smartcn ]; then
|
||||||
|
|
||||||
|
# Download plugin package locally
|
||||||
|
echo 'Copying smartcn plugin...';
|
||||||
|
cp /opt/bitnami/elasticsearch/analysis-smartcn.zip /tmp/analysis-smartcn.zip
|
||||||
|
|
||||||
|
elasticsearch-plugin install file:///tmp/analysis-smartcn.zip
|
||||||
|
if [[ "$$?" != "0" ]]; then
|
||||||
|
echo 'Plugin installation failed, exiting operation';
|
||||||
|
rm -rf /opt/bitnami/elasticsearch/plugins/analysis-smartcn
|
||||||
|
exit 1;
|
||||||
|
fi;
|
||||||
|
rm -f /tmp/analysis-smartcn.zip;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
# Create marker file indicating plugin installation success
|
||||||
|
touch /tmp/es_plugins_ready;
|
||||||
|
echo 'Plugin installation successful, marker file created';
|
||||||
|
|
||||||
|
# Start Elasticsearch
|
||||||
|
exec /opt/bitnami/scripts/elasticsearch/entrypoint.sh /opt/bitnami/scripts/elasticsearch/run.sh
|
||||||
|
|
||||||
|
echo -e "⏳ Adjusting Elasticsearch disk watermark settings..."
|
||||||
|
"
|
||||||
|
|
||||||
|
minio:
|
||||||
|
image: minio/minio:RELEASE.2025-06-13T11-33-47Z-cpuv1
|
||||||
|
container_name: coze-minio
|
||||||
|
user: root
|
||||||
|
privileged: true
|
||||||
|
profiles: ['middleware']
|
||||||
|
env_file: *env_file
|
||||||
|
ports:
|
||||||
|
- '9000:9000'
|
||||||
|
- '9001:9001'
|
||||||
|
volumes:
|
||||||
|
- ./data/minio:/data
|
||||||
|
environment:
|
||||||
|
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
|
||||||
|
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-minioadmin123}
|
||||||
|
MINIO_DEFAULT_BUCKETS: ${MINIO_BUCKET:-opencoze},${MINIO_DEFAULT_BUCKETS:-milvus}
|
||||||
|
command: server /data --console-address ":9001"
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
[
|
||||||
|
'CMD-SHELL',
|
||||||
|
'/usr/bin/mc alias set health_check http://localhost:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD} && /usr/bin/mc ready health_check',
|
||||||
|
]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 30s
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
|
||||||
|
etcd:
|
||||||
|
image: bitnami/etcd:3.5
|
||||||
|
container_name: coze-etcd
|
||||||
|
user: root
|
||||||
|
privileged: true
|
||||||
|
profiles: ['middleware']
|
||||||
|
env_file: *env_file
|
||||||
|
environment:
|
||||||
|
- ETCD_AUTO_COMPACTION_MODE=revision
|
||||||
|
- ETCD_AUTO_COMPACTION_RETENTION=1000
|
||||||
|
- ETCD_QUOTA_BACKEND_BYTES=4294967296
|
||||||
|
- ALLOW_NONE_AUTHENTICATION=yes
|
||||||
|
ports:
|
||||||
|
- 2379:2379
|
||||||
|
- 2380:2380
|
||||||
|
volumes:
|
||||||
|
- ./data/bitnami/etcd:/bitnami/etcd:rw,Z
|
||||||
|
- ./volumes/etcd/etcd.conf.yml:/opt/bitnami/etcd/conf/etcd.conf.yml:ro,Z
|
||||||
|
command: >
|
||||||
|
bash -c "
|
||||||
|
/opt/bitnami/scripts/etcd/setup.sh
|
||||||
|
# Set proper permissions for data and config directories
|
||||||
|
chown -R etcd:etcd /bitnami/etcd
|
||||||
|
chmod g+s /bitnami/etcd
|
||||||
|
|
||||||
|
exec /opt/bitnami/scripts/etcd/entrypoint.sh /opt/bitnami/scripts/etcd/run.sh
|
||||||
|
"
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'etcdctl', 'endpoint', 'health']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 10s
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
|
||||||
|
milvus:
|
||||||
|
container_name: coze-milvus
|
||||||
|
image: milvusdb/milvus:v2.5.10
|
||||||
|
user: root
|
||||||
|
privileged: true
|
||||||
|
profiles: ['middleware']
|
||||||
|
env_file: *env_file
|
||||||
|
command: >
|
||||||
|
bash -c "
|
||||||
|
# Set proper permissions for data directories
|
||||||
|
chown -R root:root /var/lib/milvus
|
||||||
|
chmod g+s /var/lib/milvus
|
||||||
|
|
||||||
|
exec milvus run standalone
|
||||||
|
"
|
||||||
|
security_opt:
|
||||||
|
- seccomp:unconfined
|
||||||
|
environment:
|
||||||
|
ETCD_ENDPOINTS: coze-etcd:2379
|
||||||
|
MINIO_ADDRESS: coze-minio:9000
|
||||||
|
MINIO_BUCKET_NAME: ${MINIO_BUCKET:-milvus}
|
||||||
|
MINIO_ACCESS_KEY_ID: ${MINIO_ROOT_USER:-minioadmin}
|
||||||
|
MINIO_SECRET_ACCESS_KEY: ${MINIO_ROOT_PASSWORD:-minioadmin123}
|
||||||
|
MINIO_USE_SSL: false
|
||||||
|
LOG_LEVEL: debug
|
||||||
|
volumes:
|
||||||
|
- ./data/milvus:/var/lib/milvus:rw,Z
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'curl', '-f', 'http://localhost:9091/healthz']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 10s
|
||||||
|
ports:
|
||||||
|
- '19530:19530'
|
||||||
|
- '9091:9091'
|
||||||
|
depends_on:
|
||||||
|
etcd:
|
||||||
|
condition: service_healthy
|
||||||
|
minio:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
nsqlookupd:
|
||||||
|
image: nsqio/nsq:v1.2.1
|
||||||
|
container_name: coze-nsqlookupd
|
||||||
|
command: /nsqlookupd
|
||||||
|
profiles: ['middleware']
|
||||||
|
ports:
|
||||||
|
- '4160:4160'
|
||||||
|
- '4161:4161'
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD-SHELL', 'nsqlookupd --version']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 10s
|
||||||
|
|
||||||
|
nsqd:
|
||||||
|
image: nsqio/nsq:v1.2.1
|
||||||
|
container_name: coze-nsqd
|
||||||
|
command: /nsqd --lookupd-tcp-address=coze-nsqlookupd:4160 --broadcast-address=coze-nsqd
|
||||||
|
profiles: ['middleware']
|
||||||
|
ports:
|
||||||
|
- '4150:4150'
|
||||||
|
- '4151:4151'
|
||||||
|
depends_on:
|
||||||
|
nsqlookupd:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD-SHELL', '/nsqd --version']
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 10
|
||||||
|
start_period: 10s
|
||||||
|
|
||||||
|
nsqadmin:
|
||||||
|
image: nsqio/nsq:v1.2.1
|
||||||
|
container_name: coze-nsqadmin
|
||||||
|
command: /nsqadmin --lookupd-http-address=coze-nsqlookupd:4161
|
||||||
|
profiles: ['middleware']
|
||||||
|
ports:
|
||||||
|
- '4171:4171'
|
||||||
|
depends_on:
|
||||||
|
nsqlookupd:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
|
||||||
|
minio-setup:
|
||||||
|
image: minio/mc:RELEASE.2025-05-21T01-59-54Z-cpuv1
|
||||||
|
container_name: coze-minio-setup
|
||||||
|
profiles: ['middleware']
|
||||||
|
env_file: *env_file
|
||||||
|
depends_on:
|
||||||
|
minio:
|
||||||
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
- ./volumes/minio/default_icon/:/default_icon
|
||||||
|
- ./volumes/minio/official_plugin_icon/:/official_plugin_icon
|
||||||
|
entrypoint: >
|
||||||
|
/bin/sh -c "
|
||||||
|
(/usr/bin/mc alias set localminio http://coze-minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD} && \
|
||||||
|
/usr/bin/mc mb --ignore-existing localminio/${STORAGE_BUCKET} && \
|
||||||
|
/usr/bin/mc cp --recursive /default_icon/ localminio/${STORAGE_BUCKET}/default_icon/ && \
|
||||||
|
/usr/bin/mc cp --recursive /official_plugin_icon/ localminio/${STORAGE_BUCKET}/official_plugin_icon/ && \
|
||||||
|
echo 'upload files to minio complete: Files uploaded to ${STORAGE_BUCKET} bucket.') || exit 1; \
|
||||||
|
"
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
restart: 'no'
|
||||||
|
|
||||||
|
mysql-setup-schema:
|
||||||
|
image: arigaio/atlas:0.35.0-community-alpine
|
||||||
|
container_name: coze-mysql-setup-schema
|
||||||
|
profiles: ['middleware', 'mysql-setup', 'run-server']
|
||||||
|
env_file: *env_file
|
||||||
|
depends_on:
|
||||||
|
mysql:
|
||||||
|
condition: service_healthy
|
||||||
|
volumes:
|
||||||
|
- ./atlas/opencoze_latest_schema.hcl:/opencoze_latest_schema.hcl
|
||||||
|
entrypoint:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
set -ex
|
||||||
|
TMP_ATLAS_URL="${ATLAS_URL}"
|
||||||
|
if [ "${MYSQL_HOST}" = "localhost" ] || [ "${MYSQL_HOST}" = "127.0.0.1" ]; then
|
||||||
|
echo "MYSQL_HOST is localhost or 127.0.0.1, replacing with docker network address"
|
||||||
|
TMP_ATLAS_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@mysql:${MYSQL_PORT}/${MYSQL_DATABASE}?charset=utf8mb4&parseTime=True"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "final atlas url: $${TMP_ATLAS_URL}"
|
||||||
|
for i in `seq 1 60`; do
|
||||||
|
if atlas schema apply \
|
||||||
|
-u "$${TMP_ATLAS_URL}" \
|
||||||
|
--to file:///opencoze_latest_schema.hcl \
|
||||||
|
--exclude "atlas_schema_revisions,table_*" \
|
||||||
|
--auto-approve; then
|
||||||
|
echo "MySQL setup complete."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "atlas schema apply failed, retrying...($$i/60)"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
echo "MySQL setup failed after 60 retries."
|
||||||
|
exit 1
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
mysql-setup-init-sql:
|
||||||
|
image: mysql:8.4.5
|
||||||
|
container_name: coze-mysql-setup-init-sql
|
||||||
|
profiles: ['middleware', 'mysql-setup', 'run-server', 'volcano-setup']
|
||||||
|
env_file: *env_file
|
||||||
|
depends_on:
|
||||||
|
mysql:
|
||||||
|
condition: service_healthy
|
||||||
|
command:
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- |
|
||||||
|
set -ex
|
||||||
|
for i in $$(seq 1 60); do
|
||||||
|
DB_HOST="$${MYSQL_HOST}"
|
||||||
|
if [ "$${MYSQL_HOST}" = "localhost" ] || [ "$${MYSQL_HOST}" = "127.0.0.1" ]; then
|
||||||
|
DB_HOST="mysql"
|
||||||
|
fi
|
||||||
|
if mysql -h "$${DB_HOST}" -P"$${MYSQL_PORT}" -u"$${MYSQL_USER}" -p"$${MYSQL_PASSWORD}" "$${MYSQL_DATABASE}" < /schema.sql && \
|
||||||
|
mysql -h "$${DB_HOST}" -P"$${MYSQL_PORT}" -u"$${MYSQL_USER}" -p"$${MYSQL_PASSWORD}" "$${MYSQL_DATABASE}" < /sql_init.sql; then
|
||||||
|
echo 'MySQL init success.'
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "Retrying to connect to mysql... ($$i/60)"
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
echo 'Failed to init mysql db.'
|
||||||
|
exit 1
|
||||||
|
volumes:
|
||||||
|
- ./volumes/mysql/sql_init.sql:/sql_init.sql
|
||||||
|
- ./volumes/mysql/schema.sql:/schema.sql
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
restart: 'no'
|
||||||
|
|
||||||
|
coze-server:
|
||||||
|
# build:
|
||||||
|
# context: ../
|
||||||
|
# dockerfile: backend/Dockerfile
|
||||||
|
image: opencoze/opencoze:latest
|
||||||
|
container_name: coze-server
|
||||||
|
profiles: ['run-server']
|
||||||
|
env_file: *env_file
|
||||||
|
environment:
|
||||||
|
LISTEN_ADDR: 0.0.0.0:8888
|
||||||
|
networks:
|
||||||
|
- coze-network
|
||||||
|
ports:
|
||||||
|
- '8888:8888'
|
||||||
|
- '8889:8889'
|
||||||
|
volumes:
|
||||||
|
- .env:/app/.env
|
||||||
|
- ../backend/conf:/app/resources/conf
|
||||||
|
# - ../backend/static:/app/resources/static
|
||||||
|
depends_on:
|
||||||
|
mysql:
|
||||||
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
# rocketmq-namesrv:
|
||||||
|
# condition: service_healthy
|
||||||
|
# rocketmq-broker:
|
||||||
|
# condition: service_healthy
|
||||||
|
elasticsearch:
|
||||||
|
condition: service_healthy
|
||||||
|
minio:
|
||||||
|
condition: service_healthy
|
||||||
|
milvus:
|
||||||
|
condition: service_healthy
|
||||||
|
minio-setup:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
mysql-setup-init-sql:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
command: ['/app/bootstrap.sh']
|
||||||
|
|
||||||
|
networks:
|
||||||
|
coze-network:
|
||||||
|
driver: bridge
|
||||||
|
|
@ -11,10 +11,9 @@ services:
|
||||||
MYSQL_DATABASE: ${MYSQL_DATABASE:-opencoze}
|
MYSQL_DATABASE: ${MYSQL_DATABASE:-opencoze}
|
||||||
MYSQL_USER: ${MYSQL_USER:-coze}
|
MYSQL_USER: ${MYSQL_USER:-coze}
|
||||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-coze123}
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-coze123}
|
||||||
profiles: ['middleware', 'mysql-setup', 'mysql']
|
|
||||||
env_file: *env_file
|
env_file: *env_file
|
||||||
ports:
|
ports:
|
||||||
- '3306:3306'
|
- '3306'
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/mysql:/var/lib/mysql
|
- ./data/mysql:/var/lib/mysql
|
||||||
- ./volumes/mysql/schema.sql:/docker-entrypoint-initdb.d/init.sql
|
- ./volumes/mysql/schema.sql:/docker-entrypoint-initdb.d/init.sql
|
||||||
|
|
@ -45,7 +44,6 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
user: root
|
user: root
|
||||||
privileged: true
|
privileged: true
|
||||||
profiles: ['middleware']
|
|
||||||
env_file: *env_file
|
env_file: *env_file
|
||||||
environment:
|
environment:
|
||||||
- REDIS_AOF_ENABLED=${REDIS_AOF_ENABLED:-no}
|
- REDIS_AOF_ENABLED=${REDIS_AOF_ENABLED:-no}
|
||||||
|
|
@ -53,7 +51,7 @@ services:
|
||||||
- REDIS_IO_THREADS=${REDIS_IO_THREADS:-4}
|
- REDIS_IO_THREADS=${REDIS_IO_THREADS:-4}
|
||||||
- ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD:-yes}
|
- ALLOW_EMPTY_PASSWORD=${ALLOW_EMPTY_PASSWORD:-yes}
|
||||||
ports:
|
ports:
|
||||||
- '6379:6379'
|
- '6379'
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/bitnami/redis:/bitnami/redis/data:rw,Z
|
- ./data/bitnami/redis:/bitnami/redis/data:rw,Z
|
||||||
command: >
|
command: >
|
||||||
|
|
@ -79,14 +77,13 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
user: root
|
user: root
|
||||||
privileged: true
|
privileged: true
|
||||||
profiles: ['middleware']
|
|
||||||
env_file: *env_file
|
env_file: *env_file
|
||||||
environment:
|
environment:
|
||||||
- TEST=1
|
- TEST=1
|
||||||
# Add Java certificate trust configuration
|
# Add Java certificate trust configuration
|
||||||
# - ES_JAVA_OPTS=-Djdk.tls.client.protocols=TLSv1.2 -Dhttps.protocols=TLSv1.2 -Djavax.net.ssl.trustAll=true -Xms4096m -Xmx4096m
|
# - ES_JAVA_OPTS=-Djdk.tls.client.protocols=TLSv1.2 -Dhttps.protocols=TLSv1.2 -Djavax.net.ssl.trustAll=true -Xms4096m -Xmx4096m
|
||||||
ports:
|
ports:
|
||||||
- '9200:9200'
|
- '9200'
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/bitnami/elasticsearch:/bitnami/elasticsearch/data
|
- ./data/bitnami/elasticsearch:/bitnami/elasticsearch/data
|
||||||
- ./volumes/elasticsearch/elasticsearch.yml:/opt/bitnami/elasticsearch/config/my_elasticsearch.yml
|
- ./volumes/elasticsearch/elasticsearch.yml:/opt/bitnami/elasticsearch/config/my_elasticsearch.yml
|
||||||
|
|
@ -147,11 +144,10 @@ services:
|
||||||
user: root
|
user: root
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
profiles: ['middleware']
|
|
||||||
env_file: *env_file
|
env_file: *env_file
|
||||||
ports:
|
ports:
|
||||||
- '9000:9000'
|
- '9000'
|
||||||
- '9001:9001'
|
- '9001'
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/minio:/data
|
- ./data/minio:/data
|
||||||
- ./volumes/minio/default_icon/:/default_icon
|
- ./volumes/minio/default_icon/:/default_icon
|
||||||
|
|
@ -181,7 +177,6 @@ services:
|
||||||
user: root
|
user: root
|
||||||
restart: always
|
restart: always
|
||||||
privileged: true
|
privileged: true
|
||||||
profiles: ['middleware']
|
|
||||||
env_file: *env_file
|
env_file: *env_file
|
||||||
environment:
|
environment:
|
||||||
- ETCD_AUTO_COMPACTION_MODE=revision
|
- ETCD_AUTO_COMPACTION_MODE=revision
|
||||||
|
|
@ -218,7 +213,6 @@ services:
|
||||||
user: root
|
user: root
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
profiles: ['middleware']
|
|
||||||
env_file: *env_file
|
env_file: *env_file
|
||||||
command: >
|
command: >
|
||||||
bash -c "
|
bash -c "
|
||||||
|
|
@ -247,8 +241,8 @@ services:
|
||||||
retries: 10
|
retries: 10
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
ports:
|
ports:
|
||||||
- '19530:19530'
|
- '19530'
|
||||||
- '9091:9091'
|
- '9091'
|
||||||
depends_on:
|
depends_on:
|
||||||
etcd:
|
etcd:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -261,10 +255,9 @@ services:
|
||||||
container_name: coze-nsqlookupd
|
container_name: coze-nsqlookupd
|
||||||
command: /nsqlookupd
|
command: /nsqlookupd
|
||||||
restart: always
|
restart: always
|
||||||
profiles: ['middleware']
|
|
||||||
ports:
|
ports:
|
||||||
- '4160:4160'
|
- '4160'
|
||||||
- '4161:4161'
|
- '4161'
|
||||||
networks:
|
networks:
|
||||||
- coze-network
|
- coze-network
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
|
@ -278,11 +271,10 @@ services:
|
||||||
image: nsqio/nsq:v1.2.1
|
image: nsqio/nsq:v1.2.1
|
||||||
container_name: coze-nsqd
|
container_name: coze-nsqd
|
||||||
command: /nsqd --lookupd-tcp-address=coze-nsqlookupd:4160 --broadcast-address=coze-nsqd
|
command: /nsqd --lookupd-tcp-address=coze-nsqlookupd:4160 --broadcast-address=coze-nsqd
|
||||||
profiles: ['middleware']
|
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- '4150:4150'
|
- '4150'
|
||||||
- '4151:4151'
|
- '4151'
|
||||||
depends_on:
|
depends_on:
|
||||||
nsqlookupd:
|
nsqlookupd:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -299,10 +291,9 @@ services:
|
||||||
image: nsqio/nsq:v1.2.1
|
image: nsqio/nsq:v1.2.1
|
||||||
container_name: coze-nsqadmin
|
container_name: coze-nsqadmin
|
||||||
command: /nsqadmin --lookupd-http-address=coze-nsqlookupd:4161
|
command: /nsqadmin --lookupd-http-address=coze-nsqlookupd:4161
|
||||||
profiles: ['middleware']
|
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- '4171:4171'
|
- '4171'
|
||||||
depends_on:
|
depends_on:
|
||||||
nsqlookupd:
|
nsqlookupd:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
|
@ -316,7 +307,6 @@ services:
|
||||||
image: opencoze/opencoze:latest
|
image: opencoze/opencoze:latest
|
||||||
restart: always
|
restart: always
|
||||||
container_name: coze-server
|
container_name: coze-server
|
||||||
profiles: ['run-server']
|
|
||||||
env_file: *env_file
|
env_file: *env_file
|
||||||
environment:
|
environment:
|
||||||
LISTEN_ADDR: 0.0.0.0:8888
|
LISTEN_ADDR: 0.0.0.0:8888
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
module github.com/coze-dev/coze-studio/docker/proxy
|
|
||||||
|
|
||||||
go 1.24.1
|
|
||||||
|
|
@ -1,100 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2025 coze-dev Authors
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"io"
|
|
||||||
"log"
|
|
||||||
"net"
|
|
||||||
"os"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
proxyURLListString := os.Getenv("COZE_SERVER_PROXY_URL_LIST")
|
|
||||||
if proxyURLListString == "" {
|
|
||||||
proxyURLListString = "mysql:3306,redis:6379,elasticsearch:9200,milvus:19530,minio:9000,nsqd:4150"
|
|
||||||
}
|
|
||||||
|
|
||||||
proxyURLList := strings.Split(proxyURLListString, ",")
|
|
||||||
for _, serverAddInDockerNet := range proxyURLList {
|
|
||||||
err := listen(serverAddInDockerNet)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Printf("listen %s failed: %v\n", serverAddInDockerNet, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 阻塞主程序,防止退出
|
|
||||||
select {}
|
|
||||||
}
|
|
||||||
|
|
||||||
func listen(serverAddInDockerNet string) error {
|
|
||||||
tcpAddr, err := net.ResolveTCPAddr("tcp", serverAddInDockerNet)
|
|
||||||
if err != nil {
|
|
||||||
fmt.Printf("解析失败: %v\n", err)
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf("host %s : %s:%d\n", serverAddInDockerNet, tcpAddr.IP, tcpAddr.Port)
|
|
||||||
localAddr := fmt.Sprintf(":%d", tcpAddr.Port)
|
|
||||||
addr := fmt.Sprintf("%s:%d", tcpAddr.IP, tcpAddr.Port)
|
|
||||||
|
|
||||||
go startListener(localAddr, addr)
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func startListener(localAddr, targetAddr string) {
|
|
||||||
// 监听本地端口
|
|
||||||
listener, err := net.Listen("tcp", localAddr)
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("无法监听端口 %s: %v", localAddr, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
defer listener.Close()
|
|
||||||
|
|
||||||
log.Printf("TCP 服务器已启动,监听端口 %s\n", localAddr)
|
|
||||||
|
|
||||||
for {
|
|
||||||
// 接受客户端连接
|
|
||||||
clientConn, err := listener.Accept()
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("接受连接失败: %v", err)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理客户端连接
|
|
||||||
go handleConnection(clientConn, targetAddr)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func handleConnection(clientConn net.Conn, targetAddr string) {
|
|
||||||
defer clientConn.Close()
|
|
||||||
|
|
||||||
// 连接到目标服务器
|
|
||||||
targetConn, err := net.Dial("tcp", targetAddr)
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("无法连接到目标服务器 %s: %v", targetAddr, err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
defer targetConn.Close()
|
|
||||||
|
|
||||||
// 启动两个协程进行双向数据转发
|
|
||||||
go io.Copy(targetConn, clientConn)
|
|
||||||
io.Copy(clientConn, targetConn)
|
|
||||||
}
|
|
||||||
|
|
@ -86,10 +86,14 @@ spec:
|
||||||
value: {{ .Values.elasticsearch.username | quote }}
|
value: {{ .Values.elasticsearch.username | quote }}
|
||||||
- name: ES_PASSWORD
|
- name: ES_PASSWORD
|
||||||
value: {{ .Values.elasticsearch.password | quote }}
|
value: {{ .Values.elasticsearch.password | quote }}
|
||||||
- name: RMQ_NAME_SERVER
|
- name: MQ_NAME_SERVER
|
||||||
value: "http://{{ include "opencoze.fullname" . }}-rocketmq-namesrv:9876"
|
value: "http://{{ include "opencoze.fullname" . }}-rocketmq-namesrv:9876"
|
||||||
- name: MILVUS_ADDR
|
- name: MILVUS_ADDR
|
||||||
value: "{{ include "opencoze.fullname" . }}-milvus:19530"
|
value: "{{ include "opencoze.fullname" . }}-milvus:19530"
|
||||||
|
- name: MINIO_ENDPOINT
|
||||||
|
value: "{{ include "opencoze.fullname" . }}-minio:9000"
|
||||||
|
- name: MINIO_API_HOST
|
||||||
|
value: "http://{{ include "opencoze.fullname" . }}-minio:9000"
|
||||||
- name: MYSQL_DSN
|
- name: MYSQL_DSN
|
||||||
value: "{{ .Values.mysql.user }}:{{ .Values.mysql.password }}@tcp({{ include "opencoze.fullname" . }}-mysql:3306)/{{ .Values.mysql.database }}?charset=utf8mb4&parseTime=True&loc=Local"
|
value: "{{ .Values.mysql.user }}:{{ .Values.mysql.password }}@tcp({{ include "opencoze.fullname" . }}-mysql:3306)/{{ .Values.mysql.database }}?charset=utf8mb4&parseTime=True&loc=Local"
|
||||||
{{- range $key, $val := .Values.cozeServer.env }}
|
{{- range $key, $val := .Values.cozeServer.env }}
|
||||||
|
|
|
||||||
|
|
@ -1,101 +0,0 @@
|
||||||
{{- if .Values.kibana.enabled }}
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: {{ include "opencoze.fullname" . }}-kibana
|
|
||||||
labels:
|
|
||||||
{{- include "opencoze.labels" . | nindent 4 }}
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app.kubernetes.io/component: kibana
|
|
||||||
app.kubernetes.io/name: {{ include "opencoze.name" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app.kubernetes.io/component: kibana
|
|
||||||
app.kubernetes.io/name: {{ include "opencoze.name" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
spec:
|
|
||||||
securityContext:
|
|
||||||
runAsUser: 0
|
|
||||||
fsGroup: 1001
|
|
||||||
initContainers:
|
|
||||||
- name: wait-for-elasticsearch
|
|
||||||
image: {{ .Values.images.curl }}
|
|
||||||
env:
|
|
||||||
- name: ES_HOST
|
|
||||||
value: '{{ include "opencoze.fullname" . }}-elasticsearch'
|
|
||||||
- name: ES_PORT
|
|
||||||
value: "9200"
|
|
||||||
- name: ES_USERNAME
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ .Release.Name }}-es-secret
|
|
||||||
key: username
|
|
||||||
- name: ES_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ .Release.Name }}-es-secret
|
|
||||||
key: password
|
|
||||||
command: ['sh', '-c', 'until curl -s -u "$ES_USERNAME:$ES_PASSWORD" "http://$ES_HOST:$ES_PORT/_cluster/health?wait_for_status=yellow&timeout=1s"; do echo "waiting for elasticsearch"; sleep 2; done;']
|
|
||||||
containers:
|
|
||||||
- name: kibana
|
|
||||||
image: "{{ .Values.kibana.image.repository }}:{{ .Values.kibana.image.tag }}"
|
|
||||||
env:
|
|
||||||
- name: KIBANA_ELASTICSEARCH_URL
|
|
||||||
value: "{{ include "opencoze.fullname" . }}-elasticsearch"
|
|
||||||
command:
|
|
||||||
- /bin/bash
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
/opt/bitnami/scripts/kibana/setup.sh
|
|
||||||
chown -R kibana:kibana /bitnami/kibana
|
|
||||||
chmod g+s /bitnami/kibana
|
|
||||||
exec /opt/bitnami/scripts/kibana/entrypoint.sh /opt/bitnami/scripts/kibana/run.sh
|
|
||||||
/opt/bitnami/scripts/kibana/setup.sh
|
|
||||||
chown -R 1001:1001 /bitnami/kibana
|
|
||||||
chmod -R g+s /bitnami/kibana
|
|
||||||
exec /opt/bitnami/scripts/kibana/entrypoint.sh /opt/bitnami/scripts/kibana/run.sh
|
|
||||||
env:
|
|
||||||
- name: KIBANA_ELASTICSEARCH_URL
|
|
||||||
value: '{{ include "opencoze.fullname" . }}-elasticsearch'
|
|
||||||
- name: ELASTICSEARCH_USERNAME
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ .Release.Name }}-es-secret
|
|
||||||
key: username
|
|
||||||
- name: ELASTICSEARCH_PASSWORD
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: {{ .Release.Name }}-es-secret
|
|
||||||
key: password
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: {{ .Values.kibana.service.port }}
|
|
||||||
protocol: TCP
|
|
||||||
livenessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /api/status
|
|
||||||
port: http
|
|
||||||
initialDelaySeconds: 120
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 6
|
|
||||||
readinessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /api/status
|
|
||||||
port: http
|
|
||||||
initialDelaySeconds: 30
|
|
||||||
periodSeconds: 10
|
|
||||||
timeoutSeconds: 5
|
|
||||||
failureThreshold: 6
|
|
||||||
volumeMounts:
|
|
||||||
- name: kibana-data
|
|
||||||
mountPath: /bitnami/kibana
|
|
||||||
volumes:
|
|
||||||
- name: kibana-data
|
|
||||||
emptyDir: {}
|
|
||||||
{{- end }}
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
{{- if .Values.kibana.enabled }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: {{ include "opencoze.fullname" . }}-kibana
|
|
||||||
labels:
|
|
||||||
{{- include "opencoze.labels" . | nindent 4 }}
|
|
||||||
spec:
|
|
||||||
type: {{ .Values.kibana.service.type }}
|
|
||||||
ports:
|
|
||||||
- port: {{ .Values.kibana.service.port }}
|
|
||||||
targetPort: http
|
|
||||||
protocol: TCP
|
|
||||||
name: http
|
|
||||||
selector:
|
|
||||||
app.kubernetes.io/component: kibana
|
|
||||||
app.kubernetes.io/name: {{ include "opencoze.name" . }}
|
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
@ -22,7 +22,7 @@ spec:
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: wait-for-namesrv
|
- name: wait-for-namesrv
|
||||||
image: opencoze-cn-beijing.cr.volces.com/iac/busybox:latest
|
image: busybox:latest
|
||||||
command: ['sh', '-c', 'until nc -z {{ .Release.Name }}-rocketmq-namesrv 9876; do echo waiting for namesrv; sleep 2; done']
|
command: ['sh', '-c', 'until nc -z {{ .Release.Name }}-rocketmq-namesrv 9876; do echo waiting for namesrv; sleep 2; done']
|
||||||
volumes:
|
volumes:
|
||||||
- name: broker-config
|
- name: broker-config
|
||||||
|
|
|
||||||
|
|
@ -62,11 +62,8 @@ cozeServer:
|
||||||
LOG_LEVEL: "debug"
|
LOG_LEVEL: "debug"
|
||||||
MAX_REQUEST_BODY_SIZE: "1073741824"
|
MAX_REQUEST_BODY_SIZE: "1073741824"
|
||||||
STORAGE_TYPE: "minio"
|
STORAGE_TYPE: "minio"
|
||||||
STORAGE_BUCKET: "opencoze"
|
|
||||||
MINIO_PROXY_ENDPOINT: ":8889"
|
MINIO_PROXY_ENDPOINT: ":8889"
|
||||||
COZE_MQ_TYPE: rmq
|
COZE_MQ_TYPE: rmq
|
||||||
MQ_NAME_SERVER: "127.0.0.1:9876"
|
|
||||||
MINIO_ENDPOINT: "127.0.0.1:9000"
|
|
||||||
ES_VERSION: "v8"
|
ES_VERSION: "v8"
|
||||||
VECTOR_STORE_TYPE: "milvus"
|
VECTOR_STORE_TYPE: "milvus"
|
||||||
EMBEDDING_TYPE: "ark"
|
EMBEDDING_TYPE: "ark"
|
||||||
|
|
@ -96,7 +93,6 @@ cozeServer:
|
||||||
VE_IMAGEX_DOMAIN: ""
|
VE_IMAGEX_DOMAIN: ""
|
||||||
VE_IMAGEX_TEMPLATE: ""
|
VE_IMAGEX_TEMPLATE: ""
|
||||||
VE_IMAGEX_UPLOAD_HOST: "https://imagex.volcengineapi.com"
|
VE_IMAGEX_UPLOAD_HOST: "https://imagex.volcengineapi.com"
|
||||||
COZE_SERVER_PROXY_URL_LIST: "opencoze-mysql:3306,opencoze-redis:6379,opencoze-elasticsearch:9200,opencoze-milvus:19530,opencoze-minio:9000,opencoze-rocketmq-namesrv:9876"
|
|
||||||
|
|
||||||
rocketmq:
|
rocketmq:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
@ -222,15 +218,6 @@ milvus:
|
||||||
storageClassName: ""
|
storageClassName: ""
|
||||||
size: "20Gi"
|
size: "20Gi"
|
||||||
|
|
||||||
kibana:
|
|
||||||
enabled: true
|
|
||||||
image:
|
|
||||||
repository: bitnami/kibana
|
|
||||||
tag: 8.18.0
|
|
||||||
service:
|
|
||||||
type: ClusterIP
|
|
||||||
port: 5601
|
|
||||||
|
|
||||||
|
|
||||||
images:
|
images:
|
||||||
busybox: busybox:latest
|
busybox: busybox:latest
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,14 @@ BIN_DIR="$BASE_DIR/bin"
|
||||||
CONFIG_DIR="$BIN_DIR/resources/conf"
|
CONFIG_DIR="$BIN_DIR/resources/conf"
|
||||||
RESOURCES_DIR="$BIN_DIR/resources/"
|
RESOURCES_DIR="$BIN_DIR/resources/"
|
||||||
DOCKER_DIR="$BASE_DIR/docker"
|
DOCKER_DIR="$BASE_DIR/docker"
|
||||||
source "$DOCKER_DIR/.env"
|
# source "$DOCKER_DIR/.env"
|
||||||
|
ENV_FILE="$DOCKER_DIR/.env"
|
||||||
|
|
||||||
|
if [[ "$APP_ENV" == "debug" ]]; then
|
||||||
|
ENV_FILE="$DOCKER_DIR/.env.debug"
|
||||||
|
fi
|
||||||
|
|
||||||
|
source "$ENV_FILE"
|
||||||
|
|
||||||
if [[ "$CODE_RUNNER_TYPE" == "sandbox" ]] && ! command -v deno &> /dev/null; then
|
if [[ "$CODE_RUNNER_TYPE" == "sandbox" ]] && ! command -v deno &> /dev/null; then
|
||||||
echo "deno is not installed, installing now..."
|
echo "deno is not installed, installing now..."
|
||||||
|
|
@ -47,20 +54,13 @@ fi
|
||||||
echo "✅ Build completed successfully!"
|
echo "✅ Build completed successfully!"
|
||||||
|
|
||||||
echo "📑 Copying environment file..."
|
echo "📑 Copying environment file..."
|
||||||
if [ -f "$DOCKER_DIR/.env" ]; then
|
if [ -f "$ENV_FILE" ]; then
|
||||||
cp "$DOCKER_DIR/.env" "$BIN_DIR/.env"
|
cp "$ENV_FILE" "$BIN_DIR"
|
||||||
else
|
else
|
||||||
echo "❌ .env file not found in $DOCKER_DIR"
|
echo "❌ .env file not found in $DOCKER_DIR"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$DOCKER_DIR/cert.pem" ]; then
|
|
||||||
cp "$DOCKER_DIR/cert.pem" "$BIN_DIR/cert.pem"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "$DOCKER_DIR/key.pem" ]; then
|
|
||||||
cp "$DOCKER_DIR/key.pem" "$BIN_DIR/key.pem"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "📑 Cleaning configuration files..."
|
echo "📑 Cleaning configuration files..."
|
||||||
rm -rf "$CONFIG_DIR"
|
rm -rf "$CONFIG_DIR"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue