Merge branch 'main' of ssh://git.agentcarrier.cn:2222/zhaoqingliang/data-ge
no conficts
This commit is contained in:
17
Dockerfile
Normal file
17
Dockerfile
Normal file
@ -0,0 +1,17 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
# 设置 pip 全局使用国内源
|
||||
ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple/
|
||||
ENV PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
13
docker-compose.yml
Normal file
13
docker-compose.yml
Normal file
@ -0,0 +1,13 @@
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
ports:
|
||||
- "8060:8000"
|
||||
volumes:
|
||||
- .:/app
|
||||
environment:
|
||||
- PYTHONUNBUFFERED=1
|
||||
# 开发模式:启用 --reload
|
||||
command: uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
|
||||
# 生产模式:注释上面 command,取消注释下面这行
|
||||
# command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
|
||||
Reference in New Issue
Block a user