ALM-backend / Dockerfile
AIZEN-007's picture
Update Dockerfile
a928721 verified
raw
history blame contribute delete
884 Bytes
# Use a slim Python base
FROM python:3.10-slim
# system deps for librosa/soundfile and general build
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ffmpeg \
libsndfile1 \
&& rm -rf /var/lib/apt/lists/*
# create app dir
WORKDIR /app
# copy dependency files first (cache pip)
COPY requirements.txt /app/requirements.txt
# install pip deps
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r /app/requirements.txt
# copy application code
COPY . /app
# Expose the port Spaces will route to
EXPOSE 7860
# healthcheck (optional)
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s \
CMD curl -f http://localhost:8080/health || exit 1
# Start the app (use server:app because your FastAPI app object is 'app' in server.py)
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]