Spaces:
Runtime error
Runtime error
| # Use an official Python runtime as a parent image | |
| FROM python:3.10-slim-buster | |
| # Set the working directory in the container to /app | |
| WORKDIR /app | |
| # Copy the current directory contents into the container at /app | |
| COPY . /app | |
| # Install system dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends git && \ | |
| apt-get clean && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Install Python dependencies | |
| RUN pip install poetry gradio | |
| # Create a non-root user and change ownership of the /app directory | |
| RUN adduser --disabled-password --gecos '' myuser && \ | |
| chown -R myuser:myuser /app | |
| # Switch to the non-root user | |
| USER myuser | |
| # Expose the port Gradio runs on | |
| EXPOSE 7860 | |
| RUN chmod +x /app/start.sh | |
| # Run the start script when the container launches | |
| CMD ["/app/start.sh"] | |