Spaces:
Running
Running
File size: 1,567 Bytes
457650b f3129df 457650b f2cfb3a 8de81aa 8f9e4eb f3129df 972e168 01309b3 457650b 972e168 fccff0d 5446b88 972e168 5446b88 5c28766 cc6fca5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
FROM python:3.11.3
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set the working directory to the user's home directory
WORKDIR $HOME
# Get secret OPENAI_API_KEY and clone it as repo at buildtime / changed required to true
RUN --mount=type=secret,id=OPENAI_API_KEY,mode=0444,required=true
# Langsmith tracing integration
RUN --mount=type=secret,id=LANGCHAIN_API_KEY,mode=0444,required=true
# HF private spaces token access
RUN --mount=type=secret,id=HUGGINGFACEHUB_API_TOKEN,mode=0444,required=true \
cat /run/secrets/HUGGINGFACEHUB_API_TOKEN > /home/user/cli_token
# Azure BING Search AI API
RUN --mount=type=secret,id=BING_SUBSCRIPTION_KEY,mode=0444,required=true
RUN pip install -U "huggingface_hub[cli]"
RUN git init & git config --global credential.helper store
RUN huggingface-cli login --token $(cat /home/user/cli_token) --add-to-git-credential
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME
# Clone and run ea4all-agentic-system
RUN git clone https://avfranco:$(cat cli_token)@huggingface.co/spaces/avfranco/ea4all_agentic_live
WORKDIR /home/user/ea4all_agentic_live
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Install graphviz dependency
USER root
RUN apt-get update \
&& xargs -a packages.txt apt-get install -y \
&& apt-get clean
USER user
CMD ["python","app.py"] |