PanagiotisMark's picture
.
9ab83af
raw
history blame
849 Bytes
# 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"]