Spaces:
Running
Running
FROM python:3.9 | |
WORKDIR /code | |
COPY ./requirements.txt /code/requirements.txt | |
RUN pip install --no-cache-dir --upgrade pip | |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
COPY . . | |
# Expose the secret AZURE_OPENAI_API_KEY at buildtime | |
RUN --mount=type=secret,id=AZURE_OPENAI_API_KEY,mode=0444,required=true \ | |
export AZURE_OPENAI_API_KEY=$(cat /run/secrets/AZURE_OPENAI_API_KEY) | |
# Expose the secret AZURE_OPENAI_ENDPOINT at buildtime | |
RUN --mount=type=secret,id=AZURE_OPENAI_ENDPOINT,mode=0444,required=true \ | |
export AZURE_OPENAI_ENDPOINT=$(cat /run/secrets/AZURE_OPENAI_ENDPOINT) | |
# must define the address and port because Hugging Face will expect to serve the application on port 7860 | |
# specify the allow-websocket-origin flag to enable the connection to the server’s websocket | |
CMD ["panel", "serve", "/code/app.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin", "*"] | |
# these may not be necessary | |
#RUN mkdir /.cache | |
#RUN chmod 777 /.cache | |
#RUN mkdir .chroma | |
#RUN chmod 777 .chroma |