File size: 898 Bytes
3039926
 
 
 
 
 
 
 
d0b1158
 
 
3039926
 
 
 
 
 
 
 
 
 
3caa669
3039926
d0b1158
 
 
 
 
 
 
 
 
 
 
3039926
 
 
 
 
 
 
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
33
34
35
36
37
38
39
40
41
42
FROM python:3.9-slim

# Install git, gcc, and python3-dev
RUN apt-get update && apt-get install -y \
    git \
    gcc \
    python3-dev

# Add a new user with UID 1000
RUN useradd -m -u 1000 user

# Set the working directory inside the container
WORKDIR /app

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

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire contents of the 'app' directory into the container
COPY . .

# Change ownership of the '/app' directory to the newly created user
RUN chown -R user:user /app

# Switch to the newly created user
USER user

# Set environment variables
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Change working directory to the 'app' directory
WORKDIR /app

# Expose port 7000 for the Gradio UI
EXPOSE 7000

# Command to run the Gradio UI
CMD ["python", "main.py"]