#指定基础镜像
FROM python:3.11.4

#指定镜像标签
LABEL maintainer="marslbr" \
description="building an interfaces-server based on docker"

#指定时区
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone

#指定PIP下载源
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

#复制依赖列表
COPY ./requirements.txt /requirements.txt

#更新PIP并安装依赖
RUN pip install --upgrade pip \
&& pip install --requirement /requirements.txt

#复制程序
COPY ./scripts /scripts

#指定工作目录
WORKDIR /scripts/

EXPOSE 8000

CMD ["uvicorn", "main:service", "--host", "0.0.0.0"]