|
FROM python:3.11 |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y ca-certificates curl gnupg && \ |
|
apt-get clean && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN git clone https://github.com/ErlichLiu/DeepClaude.git /app |
|
WORKDIR /app |
|
|
|
|
|
RUN pip install --no-cache-dir fastapi uvicorn python-dotenv huggingface_hub |
|
|
|
|
|
RUN grep -r "import" --include="*.py" /app | grep -v "from app" | sort | uniq | \ |
|
grep -oP "(?<=import )[a-zA-Z0-9_]+|(?<=from )[a-zA-Z0-9_]+" | sort | uniq | \ |
|
xargs -I{} pip install --no-cache-dir {} || true |
|
|
|
|
|
RUN if [ -f requirements.txt ]; then \ |
|
pip install --no-cache-dir -r requirements.txt; \ |
|
fi |
|
|
|
|
|
RUN mkdir -p /app/data && chmod -R 777 /app/data |
|
RUN mkdir -p /tmp/.cache && chmod -R 777 /tmp/.cache |
|
ENV HF_HOME=/tmp/.cache/huggingface \ |
|
HF_HUB_DISABLE_SYMLINKS_WARNING=1 \ |
|
HF_HUB_DISABLE_PROGRESS_BARS=1 \ |
|
HF_HUB_CACHE=/tmp/.cache/huggingface \ |
|
HUGGINGFACE_HUB_CACHE=/tmp/.cache/huggingface |
|
|
|
|
|
|
|
|
|
|
|
RUN touch .env |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
COPY sync_data.sh /app/sync_data.sh |
|
RUN chmod +x /app/sync_data.sh |
|
|
|
|
|
|
|
RUN chmod -R 777 /app |
|
|
|
|
|
CMD ["/app/sync_data.sh"] |
|
|