File size: 849 Bytes
00c5b22
dcd4f2d
3de6fea
9ab83af
 
 
 
 
 
 
 
 
 
 
 
 
 
e973388
00c5b22
 
9c32cf4
00c5b22
9ab83af
9c32cf4
00c5b22
 
9c32cf4
00c5b22
9c32cf4
 
9ab83af
00c5b22
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 the official Python image from the Docker Hub
FROM python:3.9.19-slim

# Create the app directory and change its ownership
RUN mkdir /app && useradd -m -u 1000 user && chown -R user:user /app

# Switch to the user
USER user

# Set environment variables
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    PYTHONUNBUFFERED=1 \
    GRADIO_ALLOW_FLAGGING=never \
    GRADIO_NUM_PORTS=1 \
    GRADIO_SERVER_NAME=0.0.0.0 \
    SYSTEM=spaces

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY --chown=user:user . /app

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Expose the port the app runs on
EXPOSE 7860

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