dify1 / Dockerfile
ftjc2021's picture
Upload 4 files
f60fbb3 verified
raw
history blame contribute delete
791 Bytes
# read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile
FROM python:3.9
# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
# Set working directory
WORKDIR /app
# Copy requirements and install dependencies
COPY --chown=user requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy all files to the container
COPY --chown=user . /app
# 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
# Command to run the application with multiple workers
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]