playgo_public_test / Dockerfile
ChenyuRabbitLove's picture
Update Dockerfile
6a4830b verified
FROM python:3.11.8
USER root
# Install dependencies
RUN apt-get update && apt-get install -y \
git \
git-lfs \
ca-certificates \
curl \
xz-utils \
--no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Install Node.js v20.18.0
RUN NODE_VERSION=v20.18.0 && \
ARCH=linux-x64 && \
curl -fsSL https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-${ARCH}.tar.xz | \
tar -xJ -C /usr/local --strip-components=1
# Verify Node.js and npm versions
RUN node -v && npm -v
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
RUN git lfs install
RUN --mount=type=secret,id=HF_UAT,mode=0444,required=true \
git clone https://ChenyuRabbitLove:$(cat /run/secrets/HF_UAT)@huggingface.co/spaces/JunyiAcademy/edu_ai_chatbot_market.git
RUN mv $HOME/app/edu_ai_chatbot_market/* $HOME/app/ && rm -rf $HOME/app/edu_ai_chatbot_market
RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
RUN --mount=type=secret,id=local_config,mode=0444,required=true \
export local_config=$(cat /run/secrets/local_config) && \
echo "export local_config=${local_config}" >> $HOME/.bashrc
CMD ["python", "app.py"]