From 00cb8cd04ec5ce29a096ed767e78bc8deea9e4c8 Mon Sep 17 00:00:00 2001 From: Kun Date: Sun, 26 Jul 2026 02:09:48 +0800 Subject: [PATCH] update 26.7.26 --- 4600Pro/tgd/README.md | 4 +- 4600Pro/tgd/README_CN.md | 4 +- 480T/dify/.env | 2 +- 480T/dify/generate_docker_compose | 4 +- 480T/home_database/.env | 23 +++++ 480T/home_database/docker-compose.yaml | 102 +++++++++++++++++++++++ 480T/rc/.env | 19 +++++ 480T/rc/compose.database.yml | 111 +++++++++++++++++++++++++ 480T/rc/compose.nats.yml | 32 +++++++ 480T/rc/compose.yml | 65 +++++++++++++++ 480T/rc/docker-compose.yaml | 0 480T/rc/docker-compose.yml | 4 + 12 files changed, 363 insertions(+), 7 deletions(-) create mode 100644 480T/home_database/.env create mode 100644 480T/rc/.env create mode 100644 480T/rc/compose.database.yml create mode 100644 480T/rc/compose.nats.yml create mode 100644 480T/rc/compose.yml delete mode 100644 480T/rc/docker-compose.yaml create mode 100644 480T/rc/docker-compose.yml diff --git a/4600Pro/tgd/README.md b/4600Pro/tgd/README.md index 57afd49..743f8a4 100755 --- a/4600Pro/tgd/README.md +++ b/4600Pro/tgd/README.md @@ -81,10 +81,10 @@ Make sure you have **docker** and **docker-compose** installed ```sh docker pull tangyoha/telegram_media_downloader:latest mkdir -p ~/app && mkdir -p ~/app/log/ && cd ~/app -wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/master/docker-compose.yaml -O docker-compose.yaml +wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/master/docker-compose.yaml -O compose.yml wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/master/config.yaml -O config.yaml wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/master/data.yaml -O data.yaml -# vi config.yaml and docker-compose.yaml +# vi config.yaml and compose.yml vi config.yaml # The first time you need to start the foreground diff --git a/4600Pro/tgd/README_CN.md b/4600Pro/tgd/README_CN.md index 9d2e03d..4b59622 100755 --- a/4600Pro/tgd/README_CN.md +++ b/4600Pro/tgd/README_CN.md @@ -82,10 +82,10 @@ pip3 install -r requirements.txt ```sh docker pull tangyoha/telegram_media_downloader:latest mkdir -p ~/app && mkdir -p ~/app/log/ && cd ~/app -wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/blob/master/docker-compose.yaml -O docker-compose.yaml +wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/blob/master/docker-compose.yaml -O compose.yml wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/blob/master/config.yaml -O config.yaml wget https://raw.githubusercontent.com/tangyoha/telegram_media_downloader/blob/master/data.yaml -O data.yaml -# vi config.yaml and docker-compose.yaml +# vi config.yaml and compose.yml vi config.yaml # 第一次需要前台启动 diff --git a/480T/dify/.env b/480T/dify/.env index 2efda9f..e90b4ad 100755 --- a/480T/dify/.env +++ b/480T/dify/.env @@ -291,6 +291,6 @@ NGINX_PROXY_READ_TIMEOUT=3600s NGINX_PROXY_SEND_TIMEOUT=3600s NGINX_ENABLE_CERTBOT_CHALLENGE=false NGINX_SOCKET_IO_UPSTREAM=api_websocket:5001 -EXPOSE_NGINX_PORT=3700 +EXPOSE_NGINX_PORT=3400 EXPOSE_NGINX_SSL_PORT=8443 COMPOSE_PROFILES=${VECTOR_STORE:-weaviate},${DB_TYPE:-postgresql},collaboration diff --git a/480T/dify/generate_docker_compose b/480T/dify/generate_docker_compose index 580091e..7ab7932 100755 --- a/480T/dify/generate_docker_compose +++ b/480T/dify/generate_docker_compose @@ -129,9 +129,9 @@ def main(): base_dir = os.path.dirname(os.path.abspath(__file__)) env_example_path = os.path.join(base_dir, ".env.example") template_path = os.path.join(base_dir, "docker-compose-template.yaml") - output_path = os.path.join(base_dir, "docker-compose.yaml") + output_path = os.path.join(base_dir, "compose.yml") - # Define header comments to be added at the top of docker-compose.yaml + # Define header comments to be added at the top of compose.yml header_comments = ( "# ==================================================================\n" "# WARNING: This file is auto-generated by generate_docker_compose\n" diff --git a/480T/home_database/.env b/480T/home_database/.env new file mode 100644 index 0000000..b486538 --- /dev/null +++ b/480T/home_database/.env @@ -0,0 +1,23 @@ +# 时区 +TZ=Asia/Shanghai + +# 镜像版本 +MYSQL_VERSION=8.4 +POSTGRES_VERSION=18 +REDIS_VERSION=8.6.5-alpine + +# 宿主机端口 +MYSQL_PORT=4100 +POSTGRES_PORT=4200 +REDIS_PORT=4300 + +# MySQL +MYSQL_ROOT_PASSWORD=nxY7HUoJYjUgn + +# PostgreSQL +POSTGRES_USER=kun +POSTGRES_PASSWORD=nxY7HUoJYjUgn +POSTGRES_DB=postgres + +# Redis +REDIS_PASSWORD=nxY7HUoJYjUgn \ No newline at end of file diff --git a/480T/home_database/docker-compose.yaml b/480T/home_database/docker-compose.yaml index e69de29..8127d24 100644 --- a/480T/home_database/docker-compose.yaml +++ b/480T/home_database/docker-compose.yaml @@ -0,0 +1,102 @@ +name: home-databases + +services: + mysql: + image: mysql:${MYSQL_VERSION:-8.4} + container_name: home_mysql + restart: unless-stopped + environment: + TZ: ${TZ:-Asia/Shanghai} + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + ports: + - "${MYSQL_PORT:-4100}:3306" + volumes: + - /volume1/docker/docker_projects/home_database/mysql:/var/lib/mysql + networks: + - database_network + healthcheck: + test: + [ + "CMD-SHELL", + "mysqladmin ping -h 127.0.0.1 -uroot -p$$MYSQL_ROOT_PASSWORD --silent" + ] + interval: 10s + timeout: 5s + retries: 10 + start_period: 30s + + + postgres: + image: postgres:${POSTGRES_VERSION:-18} + container_name: home_postgres + restart: unless-stopped + environment: + TZ: ${TZ:-Asia/Shanghai} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + POSTGRES_DB: ${POSTGRES_DB} + ports: + - "${POSTGRES_PORT:-4200}:5432" + volumes: + # PostgreSQL 18+ 建议挂载到上一级目录 + - /volume1/docker/docker_projects/home_database/postgres:/var/lib/postgresql + networks: + - database_network + healthcheck: + test: + [ + "CMD-SHELL", + "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" + ] + interval: 10s + timeout: 5s + retries: 10 + start_period: 20s + + + redis: + image: redis:${REDIS_VERSION:-8.6.5-alpine} + container_name: home_redis + restart: unless-stopped + environment: + TZ: ${TZ:-Asia/Shanghai} + REDIS_PASSWORD: ${REDIS_PASSWORD} + command: + - redis-server + - --requirepass + - ${REDIS_PASSWORD} + - --appendonly + - "yes" + - --appendfsync + - everysec + - --save + - "900" + - "1" + - --save + - "300" + - "10" + - --save + - "60" + - "10000" + ports: + - "${REDIS_PORT:-4300}:6379" + volumes: + - /volume1/docker/docker_projects/home_database/redis:/data + networks: + - database_network + healthcheck: + test: + [ + "CMD-SHELL", + "redis-cli -a \"$$REDIS_PASSWORD\" --no-auth-warning ping | grep PONG" + ] + interval: 10s + timeout: 5s + retries: 10 + start_period: 10s + + +networks: + database_network: + name: home_database_network + driver: bridge \ No newline at end of file diff --git a/480T/rc/.env b/480T/rc/.env new file mode 100644 index 0000000..acdb2ac --- /dev/null +++ b/480T/rc/.env @@ -0,0 +1,19 @@ +#!/bin/sh +# Change these +REG_TOKEN= +DOMAIN=localhost +ROOT_URL=http://localhost:5200 +RELEASE=8.6.1 +# Change to true after you set your domain and valid lets encrypt email +LETSENCRYPT_ENABLED=false +LETSENCRYPT_EMAIL=demo@email.com +TRAEFIK_PROTOCOL=http + +# MongoDB +MONGODB_BIND_IP=127.0.0.1 +MONGODB_PORT_NUMBER=27017 + +# NATS (bundled compose.nats.yml). For external NATS, set NATS_URL and omit compose.nats.yml; see docs/external-nats.md +NATS_PORT_NUMBER=4223 +NATS_BIND_IP=127.0.0.1 +# NATS_URL=monolith+nats://your-nats-host:4222 diff --git a/480T/rc/compose.database.yml b/480T/rc/compose.database.yml new file mode 100644 index 0000000..6ac58fe --- /dev/null +++ b/480T/rc/compose.database.yml @@ -0,0 +1,111 @@ +services: + mongodb-fix-permission-container: + image: docker.io/mongodb/mongodb-community-server:${MONGODB_VERSION:-8.2}-ubi8 + restart: on-failure + user: "0" + volumes: + - ${MONGODB_HOST_PATH:-mongodb_data}:/data/db:rw + environment: + MONGODB_USER_ID: ${MONGODB_USER_ID:-1001} + entrypoint: | + sh -xc ' + owner="$(stat -c %u /data/db)"; + # for fresh installs + if [ "$$owner" != "$$MONGODB_USER_ID" ]; then + echo "=====> Fixing directory ownership to uid $$MONGODB_USER_ID" + chown -R "$$MONGODB_USER_ID" /data/db; + else echo "=====> Nothing to do"; fi; + ' + # TODO: add user creation here + mongodb-init-container: + image: docker.io/mongodb/mongodb-community-server:${MONGODB_VERSION:-8.2}-ubi8 + restart: on-failure + # depends_on: + # mongodb: + # condition: service_healthy + user: "0" + environment: + MONGODB_REPLICA_SET_NAME: ${MONGODB_REPLICA_SET_NAME:-rs0} + MONGODB_PORT_NUMBER: ${MONGODB_PORT_NUMBER:-27017} + MONGODB_URI: ${MONGODB_URI:-mongodb://mongodb:27017/?directConnection=true} + MONGODB_ADVERTISED_HOSTNAME: ${MONGODB_ADVERTISED_HOSTNAME:-mongodb} + volumes: + - ${MONGODB_HOST_PATH:-mongodb_data}:/data/db:rw + logging: + driver: "json-file" + labels: + container_tag: "${COMPOSE_PROJECT_NAME:-rocketchat}#mongodb-init-container" + entrypoint: | + sh -xc ' + echo "=====> Waiting for MongoDB to be healthy before initiating replica set..."; + until mongosh "$$MONGODB_URI" --eval "db.adminCommand(\"ping\")" >/dev/null 2>&1; do + echo "=====> MongoDB not ready yet, retrying in 5 seconds..."; + sleep 5; + done; + echo "=====> Initiating ReplSet $$MONGODB_REPLICA_SET_NAME at $$MONGODB_ADVERTISED_HOSTNAME:$$MONGODB_PORT_NUMBER..."; + mongosh "$$MONGODB_URI" --eval "rs.initiate({_id: \"$$MONGODB_REPLICA_SET_NAME\", members: [{ _id: 0, host: \"$$MONGODB_ADVERTISED_HOSTNAME:$$MONGODB_PORT_NUMBER\" }]})"; + echo "=====> Initiating ReplSet done..."; + ' + + mongodb: + image: docker.io/mongodb/mongodb-community-server:${MONGODB_VERSION:-8.2}-ubi8 + restart: always + # depends_on: + # mongodb-fix-permission-container: + # condition: service_completed_successfully + volumes: + - ${MONGODB_HOST_PATH:-mongodb_data}:/data/db:rw + user: "${MONGODB_USER_ID:-1001}" + entrypoint: + - sh + - -ec + - | + echo "=====> Waiting for /data/db to be owned by uid=$$MONGODB_USER_ID (mongodb user) ..."; + for i in $(seq 1 60); do + owner="$(stat -c %u /data/db 2>/dev/null || true)"; + if [ "$$owner" = "$$MONGODB_USER_ID" ]; then + echo "=====> /data/db ownership OK ($$owner) - starting MongoDB"; + exec mongod --replSet "$$MONGODB_REPLICA_SET_NAME" --bind_ip_all; + fi; + echo "=====> /data/db owner is '$$owner' (expected $$MONGODB_USER_ID), retrying in 5 seconds..."; + sleep 5; + done; + echo "=====> Giving up waiting for /data/db ownership after 5 minutes"; + exit 1 + environment: + MONGODB_USER_ID: ${MONGODB_USER_ID:-1001} + MONGODB_REPLICA_SET_NAME: ${MONGODB_REPLICA_SET_NAME:-rs0} + MONGODB_PORT_NUMBER: ${MONGODB_PORT_NUMBER:-27017} + MONGODB_ADVERTISED_HOSTNAME: ${MONGODB_ADVERTISED_HOSTNAME:-mongodb} + ALLOW_EMPTY_PASSWORD: ${ALLOW_EMPTY_PASSWORD:-yes} + logging: + driver: "json-file" + labels: + container_tag: "${COMPOSE_PROJECT_NAME:-rocketchat}#mongodb" + healthcheck: + test: + - CMD + - mongosh + - "mongodb://${MONGODB_ADVERTISED_HOSTNAME:-mongodb}:${MONGODB_PORT_NUMBER:-27017}/?directConnection=true" + - --eval + - '"db.adminCommand(''ping'')"' + interval: 30s + timeout: 10s + retries: 10 + start_period: 30s + ports: + - "${MONGODB_BIND_IP:-127.0.0.1}:${MONGODB_PORT_NUMBER:-27017}:${MONGODB_PORT_NUMBER:-27017}" + + mongodb-exporter: + image: docker.io/percona/mongodb_exporter:${MONGODB_EXPORTER_VERSION:-0.44.0} + depends_on: + - mongodb + expose: + - 9216 + command: + - --mongodb.uri=${MONGODB_URI:-mongodb://mongodb:27017} + - --collect-all + - --compatible-mode + +volumes: + mongodb_data: {driver: local} diff --git a/480T/rc/compose.nats.yml b/480T/rc/compose.nats.yml new file mode 100644 index 0000000..31693be --- /dev/null +++ b/480T/rc/compose.nats.yml @@ -0,0 +1,32 @@ +services: + nats: + image: docker.io/nats:${NATS_VERSION:-2.11-alpine} + restart: always + expose: + - 4222 + - 8222 + - 6222 + # healthcheck: + # test: ["CMD", "nc", "-zv", "-w", "10", "nats", "4222"] + # interval: 30s + # timeout: 10s + # retries: 10 + # start_period: 30s + command: --http_port 8222 + ports: + - "${NATS_BIND_IP:-127.0.0.1}:${NATS_PORT_NUMBER:-4222}:4222" + logging: + driver: "json-file" + labels: + container_tag: "${COMPOSE_PROJECT_NAME:-rocketchat}#nats" + + nats-exporter: + image: docker.io/natsio/prometheus-nats-exporter:${NATS_EXPORTER_VERSION:-0.17.3} + depends_on: + - nats + expose: + - 7777 + command: + - -healthz + - -varz + - "http://nats:8222" diff --git a/480T/rc/compose.yml b/480T/rc/compose.yml new file mode 100644 index 0000000..1a71924 --- /dev/null +++ b/480T/rc/compose.yml @@ -0,0 +1,65 @@ +services: + rocketchat: + image: ${IMAGE:-registry.rocket.chat/rocketchat/rocket.chat}:${RELEASE:-8.0.1} + restart: always + labels: + prometheus.io/scrape: "true" + prometheus.io/port: ${METRICS_PORT:-9458} + container_tag: "${COMPOSE_PROJECT_NAME:-rocketchat}#rocketchat" + environment: + ROOT_URL: ${ROOT_URL:-http://localhost} + PORT: ${PORT:-3000} + DEPLOY_METHOD: docker + DEPLOY_PLATFORM: compose + REG_TOKEN: ${REG_TOKEN:-} + LICENSE_DEBUG: true + OVERWRITE_SETTING_Prometheus_Enabled: true + OVERWRITE_SETTING_Prometheus_Port: "${METRICS_PORT:-9458}" + MONGO_URL: ${MONGO_URL:-mongodb://mongodb:27017/rocketchat?replicaSet=rs0} + TRANSPORTER: "${NATS_URL-monolith+nats://nats:4222}" + INSTANCE_IP: "${INSTANCE_IP:-}" + # depends_on: + # mongodb-init-container: + # condition: service_completed_successfully + entrypoint: sh + command: + - -c + - | + protocol=$(echo $$MONGO_URL | awk -F'://' '{print $$1}') + if [ "$$protocol" = "mongodb+srv" ]; then + echo "=====> MongoDB is using SRV protocol, skipping healthcheck before attempting to start rocket.chat ..."; + exec node main.js; + fi + host_port=$(echo $$MONGO_URL | awk -F/ '{print $$3}') + if echo $$host_port | grep -q @; then + host_port=$(echo $$host_port | awk -F@ '{print $$2}') + fi + echo "=====> host_port: $$host_port"; + host=$${host_port%%:*} + port=$${host_port##*:} + port=$${port:-27017} + echo "=====> Waiting for MongoDB ($$host:$$port) to be ready before starting Rocket.Chat..."; + for i in $(seq 1 60); do + if nc -z $$host $$port >/dev/null 2>&1; then + echo "=====> MongoDB is up - starting Rocket.Chat"; + exec node main.js; + fi; + echo "=====> MongoDB not ready yet, retrying in 5 seconds..."; + sleep 5; + done; + echo "=====> Giving up waiting for MongoDB after 5 minutes"; + exit 1 + expose: + - ${PORT:-3000} + - ${METRICS_PORT:-9458} + ports: + - "${BIND_IP:-0.0.0.0}:${HOST_PORT:-3000}:${PORT:-3000}" + - "${BIND_IP:-0.0.0.0}:${METRICS_PORT:-9458}:${METRICS_PORT:-9458}" + logging: + driver: "json-file" + # healthcheck: + # test: ["CMD", "nc", "-zv", "-w", "10", "rocketchat", "${PORT:-3000}"] + # interval: 30s + # timeout: 10s + # retries: 10 + # start_period: 30s \ No newline at end of file diff --git a/480T/rc/docker-compose.yaml b/480T/rc/docker-compose.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/480T/rc/docker-compose.yml b/480T/rc/docker-compose.yml new file mode 100644 index 0000000..328e644 --- /dev/null +++ b/480T/rc/docker-compose.yml @@ -0,0 +1,4 @@ +include: + - compose.yml + - compose.database.yml + - compose.nats.yml \ No newline at end of file