vocal_ai / Dockerfile
dhruv2842's picture
Update Dockerfile
55a61d6 verified
FROM python:3.10-slim
# Prevents Python from writing pyc files to disk and buffers logs immediately
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV TRANSFORMERS_CACHE=/tmp/huggingface
# Set working directory
WORKDIR /app
# Install system dependencies (PyAudio, ffmpeg, SQLite-compatible tools)
RUN apt-get update && apt-get install -y \
gcc \
g++ \
make \
python3-dev \
portaudio19-dev \
libasound-dev \
ffmpeg \
libsndfile1 \
sqlite3 \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for caching
COPY requirements.txt .
# Install Python dependencies
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy rest of the app code
COPY . .
# Ensure the directory has proper permissions (for SQLite file write)
RUN chmod -R 777 /app
# Optionally: Create the DB file if your app expects it to exist
RUN touch /app/app.db
# Expose FastAPI port
EXPOSE 7860
# Run the app using Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]