j_write_public / Dockerfile
youngtsai's picture
rename jutor_write
b5e7662
raw
history blame contribute delete
816 Bytes
FROM python:3.9
USER root
RUN apt-get update && apt-get install -y \
git \
ca-certificates \
--no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
RUN --mount=type=secret,id=HF_UAT,mode=0444,required=true \
git clone https://ChenyuRabbitLove:$(cat /run/secrets/HF_UAT)@huggingface.co/spaces/junyiacademy/jutor_write.git
RUN mv $HOME/app/jutor_write/* $HOME/app/
RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
RUN --mount=type=secret,id=OPEN_AI_KEY,mode=0444,required=true \
export OPEN_AI_KEY=$(cat /run/secrets/OPEN_AI_KEY) && \
echo "export OPEN_AI_KEY=${OPEN_AI_KEY}" >> $HOME/.bashrc
CMD ["python", "app.py"]