File size: 589 Bytes
ba755a9
 
ebf11c0
ba755a9
 
ebf11c0
ba755a9
ea9f457
ba755a9
ebf11c0
 
 
9687a38
ebf11c0
 
 
 
 
ba755a9
ebf11c0
ba755a9
04e84b3
ebf11c0
ba755a9
ebf11c0
 
9687a38
ebf11c0
 
ba755a9
04e84b3
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
# Simple production Docker with Python 3.10
FROM python:3.10

# Environment variables
ENV PYTHONUNBUFFERED=1 \
    GRADIO_SERVER_NAME=0.0.0.0 \
    GRADIO_SERVER_PORT=7860

# Create user
RUN useradd -m -u 1000 user
USER user

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

WORKDIR $HOME/app

# Copy and install requirements
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# Copy app
COPY --chown=user app.py .

# Expose port
EXPOSE 7860

# Run app
CMD ["python", "app.py"]