修正 Dockerfile 和 docker-compose.yml 配置,优化环境变量设置和健康检查命令
All checks were successful
Build and Push OCI GenAI Gateway Docker Image / docker-build-push (push) Successful in 33s
All checks were successful
Build and Push OCI GenAI Gateway Docker Image / docker-build-push (push) Successful in 33s
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
# Multi-stage build for OCI GenAI to OpenAI API Gateway
|
# Multi-stage build for OCI GenAI to OpenAI API Gateway
|
||||||
FROM python:3.11-slim as builder
|
FROM python:3.11-slim AS builder
|
||||||
|
|
||||||
# 设置工作目录
|
# 设置工作目录
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -21,7 +21,8 @@ FROM python:3.11-slim
|
|||||||
# 设置环境变量
|
# 设置环境变量
|
||||||
ENV PYTHONUNBUFFERED=1 \
|
ENV PYTHONUNBUFFERED=1 \
|
||||||
PYTHONDONTWRITEBYTECODE=1 \
|
PYTHONDONTWRITEBYTECODE=1 \
|
||||||
PATH=/root/.local/bin:$PATH
|
PATH=/root/.local/bin:$PATH \
|
||||||
|
PYTHONPATH=/app/src
|
||||||
|
|
||||||
# 设置工作目录
|
# 设置工作目录
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
version: '3.8'
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
oci-genai-gateway:
|
oci-genai-gateway:
|
||||||
build:
|
build:
|
||||||
@@ -10,26 +8,20 @@ services:
|
|||||||
- "8000:8000"
|
- "8000:8000"
|
||||||
volumes:
|
volumes:
|
||||||
# 挂载 OCI 配置文件(根据实际路径调整)
|
# 挂载 OCI 配置文件(根据实际路径调整)
|
||||||
- ~/.oci:/root/.oci:ro
|
- ./.oci:/root/.oci:ro
|
||||||
# 挂载环境配置文件
|
|
||||||
- .env:/app/.env:ro
|
|
||||||
# 挂载日志目录
|
# 挂载日志目录
|
||||||
- ./logs:/app/logs
|
- ./logs:/app/logs
|
||||||
environment:
|
environment:
|
||||||
- API_TITLE=OCI GenAI to OpenAI API Gateway
|
- API_TITLE=OCI GenAI to OpenAI API Gateway
|
||||||
- API_VERSION=0.0.1
|
- API_VERSION=0.0.1
|
||||||
|
- API_KEYS=["sk-oci-genai-default-key"]
|
||||||
- DEBUG=false
|
- DEBUG=false
|
||||||
|
- OCI_CONFIG_PROFILE=DEFAULT
|
||||||
- LOG_LEVEL=INFO
|
- LOG_LEVEL=INFO
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health').read()"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 3
|
retries: 3
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
networks:
|
|
||||||
- genai-network
|
|
||||||
|
|
||||||
networks:
|
|
||||||
genai-network:
|
|
||||||
driver: bridge
|
|
||||||
|
|||||||
Reference in New Issue
Block a user