File size: 662 Bytes
161469e
265e66c
 
 
 
 
 
 
 
 
a4541ab
 
 
 
265e66c
 
edcef43
265e66c
 
 
 
 
edcef43
a4541ab
265e66c
a4541ab
265e66c
 
 
 
 
 
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
FROM python:3.12.6

# Install OpenGL dependencies and PortAudio
USER root
RUN apt-get update && apt-get install -y \
    libgl1 \
    libglib2.0-0 \
    portaudio19-dev

# Create non-root user
RUN useradd -m -u 1000 user

WORKDIR /app

# Set PATH for the non-root user
ENV PATH="/home/user/.local/bin:$PATH"

# Switch to non-root user
USER user

# Copy and install Python dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy application files
COPY --chown=user . /app

# Expose the Hugging Face Spaces default port
EXPOSE 7860

# Set the command to run the app
CMD ["python", "webapp.py"]