初始化提交
This commit is contained in:
commit
887c1f449e
963 files changed
+166869
No files matched your search
@@ -0,0 +1,23 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 编译依赖(部分 Python 包需要)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
g++ \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 安装 Python 依赖
|
||||
COPY tianmu/pyproject.toml .
|
||||
RUN pip install --no-cache-dir -e ".[all]"
|
||||
|
||||
# 复制源代码
|
||||
COPY tianmu/src/ src/
|
||||
|
||||
EXPOSE 8101
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
|
||||
CMD python -c "import urllib.request; import json; r = urllib.request.urlopen('http://localhost:8101/healthz'); d = json.loads(r.read()); assert d['status'] != 'error'" || exit 1
|
||||
|
||||
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8101"]
|
||||
Reference in new issue
Block a user