28 lines
893 B
Docker
28 lines
893 B
Docker
ARG PYTHON_IMAGE=registry.cn-hangzhou.aliyuncs.com/library/python:3.10-slim
|
|
FROM ${PYTHON_IMAGE}
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_DISABLE_PIP_VERSION_CHECK=1 \
|
|
PIP_NO_CACHE_DIR=1
|
|
|
|
ARG APT_MIRROR=mirrors.aliyun.com
|
|
ARG PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
|
|
ARG PIP_TRUSTED_HOST=mirrors.aliyun.com
|
|
|
|
RUN sed -i "s@deb.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources \
|
|
&& sed -i "s@security.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt /app/requirements.txt
|
|
RUN pip config set global.index-url "${PIP_INDEX_URL}" \
|
|
&& pip config set global.trusted-host "${PIP_TRUSTED_HOST}" \
|
|
&& pip install -r /app/requirements.txt
|
|
|
|
COPY app /app/app
|
|
|
|
EXPOSE 8020
|
|
|
|
CMD ["python", "-m", "uvicorn", "app.edge_dispatch_service:app", "--host", "0.0.0.0", "--port", "8020"]
|