Initial commit - Diabetic Dost
This commit is contained in:
+53
@@ -0,0 +1,53 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Prevent Python from writing .pyc files and enable unbuffered logging
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
PORT=8000 \
|
||||
HOST=0.0.0.0
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies (audio processing codecs, curl for healthchecks, build essentials)
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ffmpeg \
|
||||
libsndfile1 \
|
||||
curl \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install PyTorch CPU wheels and project Python requirements
|
||||
COPY Project_1-main/backend/requirements.txt /app/requirements.txt
|
||||
RUN pip install --no-cache-dir --upgrade pip && \
|
||||
pip install --no-cache-dir torch torchaudio --index-url https://download.pytorch.org/whl/cpu && \
|
||||
pip install --no-cache-dir -r /app/requirements.txt
|
||||
|
||||
# Copy project files
|
||||
COPY Project_1-main/ /app/Project_1-main/
|
||||
|
||||
# Create runtime directories for persistent outputs and datasets
|
||||
RUN mkdir -p \
|
||||
/app/Project_1-main/outputs/database \
|
||||
/app/Project_1-main/outputs/reports/sessions \
|
||||
/app/Project_1-main/outputs/logs \
|
||||
/app/Project_1-main/outputs/checkpoints \
|
||||
/app/Project_1-main/datasets/raw_audio \
|
||||
/app/Project_1-main/datasets/processed_audio \
|
||||
/app/Project_1-main/datasets/transcripts \
|
||||
/app/Project_1-main/datasets/manifests \
|
||||
/app/Project_1-main/datasets/reviewed
|
||||
|
||||
# Set working directory to backend application
|
||||
WORKDIR /app/Project_1-main/backend
|
||||
|
||||
# Expose application port
|
||||
EXPOSE 8000
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:8000/ || exit 1
|
||||
|
||||
# Start FastAPI server
|
||||
CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
Reference in New Issue
Block a user