forma-3d-review-api / Dockerfile
lomit's picture
Sync from forma-3d-review@b6d4687f5d0f2e5303758c97095ea7e38e740723
182efca verified
raw
history blame contribute delete
864 Bytes
FROM python:3.11-slim
# System libs required by cadquery-ocp (OpenCascade) and open3d.
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libgl1 \
libglib2.0-0 \
libxrender1 \
libxext6 \
libsm6 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
ENV UV_LINK_MODE=copy \
UV_COMPILE_BYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /app
# Install dependencies first for layer caching.
COPY pyproject.toml uv.lock ./
RUN uv sync --frozen --no-install-project --no-dev
# Copy the application source.
COPY . .
# Install the project itself (editable) so backend/data/ is resolvable.
RUN uv sync --frozen --no-dev
ENV PORT=8080
EXPOSE 8080
CMD ["sh", "-c", "uv run uvicorn src.api.main:app --host 0.0.0.0 --port ${PORT}"]