添加docker镜像等服务

This commit is contained in:
小贺
2025-09-06 20:17:11 +08:00
parent 307dd031eb
commit 8e7790a75c
6 changed files with 224 additions and 0 deletions

42
build-docker.sh Normal file
View File

@@ -0,0 +1,42 @@
#!/bin/bash
echo "🐳 Building SiliconFlow API Key Validator Docker image..."
# 检查Docker是否已安装
if ! command -v docker &> /dev/null; then
echo "❌ Docker is not installed. Please install Docker first."
exit 1
fi
# 安装依赖
echo "📦 Installing dependencies..."
if [ ! -d "node_modules" ]; then
npm install
fi
if [ ! -d "frontend/node_modules" ]; then
cd frontend
npm install
cd ..
fi
# 构建Docker镜像
echo "🔨 Building Docker image..."
docker build -t siliconflow-validator .
# 检查构建结果
if [ $? -eq 0 ]; then
echo "✅ Docker image built successfully!"
echo
echo "🏃‍♂️ To run the container:"
echo " docker run -p 3000:3000 siliconflow-validator"
echo
echo "🐳 To run with Docker Compose:"
echo " docker-compose up"
echo
echo "🧪 To run development container:"
echo " docker-compose --profile dev up"
else
echo "❌ Docker build failed!"
exit 1
fi