Spaces:
Sleeping
Sleeping
File size: 848 Bytes
6d33a3b 3de6fea 6d33a3b 9ab83af 6d33a3b 9ab83af 6d33a3b e973388 00c5b22 6d33a3b 9c32cf4 6d33a3b 9c32cf4 6d33a3b 895589c 6d33a3b |
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 |
# Use the official Python image from the Docker Hub
FROM python:3.9.19-slim
# Create the app directory and change its ownership
RUN mkdir /app && useradd -m -u 1000 user && chown -R user:user /app
# Switch to the user
USER user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONUNBUFFERED=1 \
GRADIO_ALLOW_FLAGGING=never \
GRADIO_NUM_PORTS=1 \
GRADIO_SERVER_NAME=0.0.0.0 \
SYSTEM=spaces
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY --chown=user:user . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Expose the port the app runs on
EXPOSE 7860
# Run gradio_app.py when the container launches
CMD ["python", "gradio_app.py"] |