File size: 782 Bytes
cb1ed56
 
 
 
 
 
 
 
 
 
 
 
 
b35e229
 
601fb3d
cb1ed56
 
 
 
 
 
 
 
b35e229
cb1ed56
 
 
 
 
d1f14b6
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
FROM python:3.9

# Install system dependencies
RUN apt-get update && apt-get install -y \

    libsndfile1 \
    && rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

WORKDIR /app

# Create cache directory
RUN mkdir -p /home/user/.cache/huggingface/hub

# Copy requirements first to leverage Docker cache
COPY --chown=user requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy the rest of the application
COPY --chown=user . /app

# Set environment variables
ENV HF_HOME=/home/user/.cache/huggingface

# Expose the port the app runs on
EXPOSE 7860

# Command to run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]