webhook-receiver / Dockerfile
Inflammable1230's picture
Create Dockerfile
5fc20e5 verified
Raw
History Blame Contribute Delete
515 Bytes
FROM python:3.10-slim
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Create a non-root user with UID 1000 required by Spaces
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME/app
# Copy files and ensure the non-root user owns them
COPY --chown=user . $HOME/app
# Bind to 0.0.0.0 and force port 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]