jeysshon commited on
Commit
c1d70a3
·
verified ·
1 Parent(s): 19b7277

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -20
Dockerfile CHANGED
@@ -1,34 +1,41 @@
1
  FROM python:3.10-slim
2
 
3
- # Instalar dependencias del sistema
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
  ffmpeg \
 
 
6
  git \
7
  build-essential \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Crear usuario
11
- RUN useradd -m -u 1000 user
12
- USER user
13
-
14
- ENV HOME=/home/user \
15
- PATH=/home/user/.local/bin:$PATH
16
 
17
- WORKDIR $HOME/app
 
 
18
 
19
- # Instalar PyTorch y dependencias principales
20
- RUN pip install --no-cache-dir --user \
21
- torch \
22
- torchaudio \
23
- gradio==4.44.0 \
24
- huggingface_hub \
25
- librosa \
26
- soundfile \
27
- numpy \
28
- scikit-learn
29
 
30
- # Copiar archivos
31
- COPY --chown=user:user . .
32
 
 
33
  EXPOSE 7860
 
 
 
 
 
 
 
 
 
 
 
34
  CMD ["python", "app.py"]
 
1
  FROM python:3.10-slim
2
 
3
+ # Set working directory
4
+ WORKDIR /app
5
+
6
+ # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  ffmpeg \
9
+ curl \
10
+ wget \
11
  git \
12
  build-essential \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Copy requirements first for better caching
16
+ COPY requirements.txt .
 
 
 
 
17
 
18
+ # Install Python dependencies
19
+ RUN pip install --no-cache-dir --upgrade pip && \
20
+ pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Copy application code
23
+ COPY . .
 
 
 
 
 
 
 
 
24
 
25
+ # Create necessary directories
26
+ RUN mkdir -p mdx_models separated_audio
27
 
28
+ # Expose port
29
  EXPOSE 7860
30
+
31
+ # Set environment variables
32
+ ENV PYTHONUNBUFFERED=1
33
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
34
+ ENV GRADIO_SERVER_PORT=7860
35
+
36
+ # Health check
37
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=60s --retries=3 \
38
+ CMD curl -f http://localhost:7860/health || exit 1
39
+
40
+ # Run the application
41
  CMD ["python", "app.py"]