TraceStudio-dist/server/Dockerfile.opt

36 lines
1.0 KiB
Docker
Raw Permalink Normal View History

2026-01-13 16:41:31 +08:00
# Multi-stage Dockerfile for TraceStudio server (optimized)
FROM python:3.10-slim as builder
WORKDIR /build
# Install build deps
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install into a wheel/cache location
COPY server/requirements.txt ./requirements.txt
RUN python -m pip install --upgrade pip setuptools wheel
RUN pip install --no-cache-dir -r requirements.txt -t /build/_deps
FROM python:3.10-slim
WORKDIR /app
# Copy installed dependencies
COPY --from=builder /build/_deps /usr/local/lib/python3.10/site-packages
# Copy server code
# Copy repository into /app so `server` package is available at /app/server
COPY . /app/
# Ensure custom nodes path exists (copied above as part of repo)
RUN mkdir -p /app/cloud/custom_nodes || true
ENV PYTHONUNBUFFERED=1
ENV CLOUD_ROOT=/opt/tracestudio/cloud
EXPOSE 8000
CMD ["python", "-m", "uvicorn", "server.main:app", "--host", "0.0.0.0", "--port", "8000"]