代码部署说明

This commit is contained in:
董宏凯 committed 2026-07-11 18:58:16 +08:00
1 parent 221e947488
commit 55b5c2cc9f
7 files changed
+727

No files matched your search

@@ -0,0 +1,32 @@
#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
IMAGE_NAME="${IMAGE_NAME:-deerflow-backend-offline:latest}"
APT_MIRROR="${APT_MIRROR:-mirrors.aliyun.com}"
UV_INDEX_URL="${UV_INDEX_URL:-https://pypi.tuna.tsinghua.edu.cn/simple/}"
UV_HTTP_TIMEOUT="${UV_HTTP_TIMEOUT:-300}"
UV_NO_CACHE="${UV_NO_CACHE:-1}"
UV_COMPILE_BYTECODE="${UV_COMPILE_BYTECODE:-0}"
UV_CONCURRENT_DOWNLOADS="${UV_CONCURRENT_DOWNLOADS:-4}"
UV_CONCURRENT_INSTALLS="${UV_CONCURRENT_INSTALLS:-4}"
UV_CONCURRENT_BUILDS="${UV_CONCURRENT_BUILDS:-2}"
PYTHON_IMAGE="${PYTHON_IMAGE:-python:3.12-slim-bookworm}"
cd "${SCRIPT_DIR}"
docker build \
-f Dockerfile.backend-offline \
-t "${IMAGE_NAME}" \
--build-arg "PYTHON_IMAGE=${PYTHON_IMAGE}" \
--build-arg "APT_MIRROR=${APT_MIRROR}" \
--build-arg "UV_INDEX_URL=${UV_INDEX_URL}" \
--build-arg "UV_HTTP_TIMEOUT=${UV_HTTP_TIMEOUT}" \
--build-arg "UV_NO_CACHE=${UV_NO_CACHE}" \
--build-arg "UV_COMPILE_BYTECODE=${UV_COMPILE_BYTECODE}" \
--build-arg "UV_CONCURRENT_DOWNLOADS=${UV_CONCURRENT_DOWNLOADS}" \
--build-arg "UV_CONCURRENT_INSTALLS=${UV_CONCURRENT_INSTALLS}" \
--build-arg "UV_CONCURRENT_BUILDS=${UV_CONCURRENT_BUILDS}" \
.
echo "Built image: ${IMAGE_NAME}"