utils / Dockerfile
Nymbo's picture
python 3.12 bookworm base, gradio 6.29 pinned, path-string file inputs, fix server_name typo, slimmer apt set
2a6ff70 verified
Raw History Blame Contribute Delete
809 Bytes
FROM python:3.12-slim-bookworm
WORKDIR /app
COPY packages.txt /tmp/packages.txt
RUN apt-get update && \
xargs -r -a /tmp/packages.txt apt-get install -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/* && apt-get clean
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /tmp/requirements.txt
# 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/app
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
EXPOSE 7860
CMD ["python","app.py"]