File size: 839 Bytes
2bb9056
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c9672bd
 
 
2bb9056
 
 
 
 
 
c9672bd
 
 
2bb9056
 
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
32
# Use an official Python runtime as the base image
FROM python:3.9-slim

# Set up a non-root user
RUN useradd -m -u 1000 user

# Set the working directory in the container
WORKDIR /app

# Copy the requirements file into the container
COPY requirements.txt .

# Install the required packages
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy the current directory contents into the container
COPY . .

# Create a directory for flagged data and set permissions
RUN mkdir /app/flagged && chown user:user /app/flagged

# Switch to the non-root user
USER user

# Make port 7860 available to the world outside this container
EXPOSE 7860

# Set Python to ignore deprecation warnings
ENV PYTHONWARNINGS="ignore:on_event is deprecated:DeprecationWarning"

# Run the Gradio app when the container launches
CMD ["python", "app.py"]