18 lines
483 B
Docker
18 lines
483 B
Docker
# 基础镜像来自 Docker Hub;请在本机配置阿里云镜像加速器后再构建(见仓库 docker-compose.yml 注释)
|
||
FROM python:3.12-slim
|
||
|
||
WORKDIR /app
|
||
|
||
ENV PYTHONDONTWRITEBYTECODE=1
|
||
ENV PYTHONUNBUFFERED=1
|
||
ENV PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
|
||
|
||
COPY requirements.txt /app/requirements.txt
|
||
RUN pip install --no-cache-dir -r /app/requirements.txt
|
||
|
||
COPY app /app/app
|
||
|
||
EXPOSE 8000
|
||
|
||
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|