Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +54 -0
Dockerfile
CHANGED
|
@@ -0,0 +1,54 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.9 slim as base image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
ffmpeg \
|
| 10 |
+
libsndfile1 \
|
| 11 |
+
libsndfile1-dev \
|
| 12 |
+
libasound2-dev \
|
| 13 |
+
libportaudio2 \
|
| 14 |
+
libportaudiocpp0 \
|
| 15 |
+
portaudio19-dev \
|
| 16 |
+
build-essential \
|
| 17 |
+
pkg-config \
|
| 18 |
+
libavcodec-dev \
|
| 19 |
+
libavformat-dev \
|
| 20 |
+
libswscale-dev \
|
| 21 |
+
libgstreamer1.0-dev \
|
| 22 |
+
libgstreamer-plugins-base1.0-dev \
|
| 23 |
+
libgtk-3-dev \
|
| 24 |
+
libpng-dev \
|
| 25 |
+
libjpeg-dev \
|
| 26 |
+
libopenexr-dev \
|
| 27 |
+
libtiff-dev \
|
| 28 |
+
libwebp-dev \
|
| 29 |
+
git \
|
| 30 |
+
wget \
|
| 31 |
+
curl \
|
| 32 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 33 |
+
|
| 34 |
+
# Copy requirements first for better caching
|
| 35 |
+
COPY requirements.txt .
|
| 36 |
+
|
| 37 |
+
# Install Python dependencies
|
| 38 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 39 |
+
|
| 40 |
+
# Copy application code
|
| 41 |
+
COPY . .
|
| 42 |
+
|
| 43 |
+
# Create directory for model file
|
| 44 |
+
RUN mkdir -p /app/models
|
| 45 |
+
|
| 46 |
+
# Expose port
|
| 47 |
+
EXPOSE 8000
|
| 48 |
+
|
| 49 |
+
# Health check
|
| 50 |
+
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
|
| 51 |
+
CMD curl -f http://localhost:8000/health || exit 1
|
| 52 |
+
|
| 53 |
+
# Run the application
|
| 54 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]
|