-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (40 loc) · 1.28 KB
/
Dockerfile
File metadata and controls
53 lines (40 loc) · 1.28 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Audio Transcription Tool - Docker Container
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
git \
wget \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better Docker layer caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create directories for models and temp files
RUN mkdir -p models temp
# Download basic Whisper model
RUN python -c "import whisper; whisper.load_model('base')"
# Set environment variables
ENV PYTHONPATH=/app
ENV HUGGINGFACE_HUB_CACHE=/app/models/huggingface
# Create non-root user for security
RUN useradd -m -u 1000 transcriber && \
chown -R transcriber:transcriber /app
USER transcriber
# Expose volume for input/output files
VOLUME ["/data"]
# Set entrypoint
ENTRYPOINT ["python", "main.py"]
CMD ["--help"]
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD python -c "import whisper; print('OK')" || exit 1
# Labels
LABEL maintainer="Audio Transcription Team"
LABEL description="Audio transcription tool with speaker diarization"
LABEL version="1.0.0"