TraceStudio/server/Dockerfile

35 lines
907 B
Docker
Raw Permalink Normal View History

2026-01-12 21:51:45 +08:00
# Multi-stage Dockerfile for TraceStudio server (production)
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 server/ /app/
# Copy custom nodes into expected location
COPY cloud/custom_nodes /app/custom_nodes
ENV PYTHONUNBUFFERED=1
ENV CLOUD_ROOT=/opt/tracestudio/cloud
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]