Spaces:
Running
Running
# Use the latest personal Ubuntu image as the starting point | |
FROM hadadrjt/ubuntu:latest | |
# Set the user to root to have full permissions during build and runtime | |
USER root | |
# Set the working directory inside the container to /usr/src/app | |
# All subsequent commands will be run in this directory | |
WORKDIR /usr/src/app | |
# Copy all files from the current directory on the host machine to the working directory in the container | |
COPY . . | |
# Install Python dependencies listed in requirements.txt without using cache to reduce image size | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Expose port 7860 so that it can be accessed from outside the container | |
EXPOSE 7860 | |
# Set an environment variable to configure the Gradio server to listen on all network interfaces | |
ENV GRADIO_SERVER_NAME="0.0.0.0" | |
# Clear any default entrypoint to allow CMD to run directly | |
ENTRYPOINT [] | |
# Specify the default command to run the Python application when the container starts | |
CMD ["python", "app.py"] |