creator_vision_demo / Dockerfile
David Baba
backend
0437edf
Raw
History Blame Contribute Delete
821 Bytes
# Backend image for Railway (or any Docker host).
FROM python:3.12-slim
# ffmpeg/ffprobe are required at runtime (frame sampling, transcode, audio for whisper).
RUN apt-get update \
&& apt-get install -y --no-install-recommends ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# uv for fast, reproducible dependency installs.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
WORKDIR /app
# Install dependencies first for better layer caching. Use the committed lock for a
# reproducible build (`requests` etc. come in transitively and are pinned there).
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-dev
# Application code.
COPY app ./app
# Railway injects $PORT; default to 8000 for local `docker run`.
ENV PORT=8000
EXPOSE 8000
CMD uv run uvicorn app.main:app --host 0.0.0.0 --port ${PORT}