FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/library/python:3.11-slim WORKDIR /app RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources && \ sed -i 's/security.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources && \ apt-get update && apt-get install -y \ gcc \ postgresql-client \ libpq-dev \ && rm -rf /var/lib/apt/lists/* COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple COPY xyzs/ ./xyzs/ RUN ls -la xyzs/AmazingData/ || echo 'Warning: AmazingData wheel files directory not found' && \ ls -la xyzs/*.whl || echo 'Warning: tgw wheel file not found' RUN if [ -f xyzs/AmazingData/AmazingData-1.0.30-cp311-none-any.whl ]; then \ pip install --no-cache-dir xyzs/AmazingData/AmazingData-1.0.30-cp311-none-any.whl -i https://pypi.tuna.tsinghua.edu.cn/simple; \ else \ echo 'Error: AmazingData wheel file not found, build will fail'; \ exit 1; \ fi RUN if [ -f xyzs/tgw-1.0.8.5-py3-none-any.whl ]; then \ pip install --no-cache-dir xyzs/tgw-1.0.8.5-py3-none-any.whl -i https://pypi.tuna.tsinghua.edu.cn/simple; \ else \ echo 'Error: tgw wheel file not found, build will fail'; \ exit 1; \ fi COPY app/ ./app/ COPY .env.example ./.env.example EXPOSE 8000 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]