File size: 957 Bytes
888cb3b c61f257 888cb3b c61f257 888cb3b c61f257 888cb3b 4e8930d 888cb3b c61f257 d1094e3 4e8930d c61f257 d1094e3 888cb3b c61f257 d1094e3 4e8930d c61f257 888cb3b c61f257 d1094e3 c61f257 888cb3b c61f257 888cb3b 4e8930d d1094e3 888cb3b | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | FROM node:20-slim AS frontend-builder
WORKDIR /app/frontend
COPY frontend/package*.json ./
RUN npm install
COPY frontend/ ./
RUN echo "VITE_API_URL=" > .env
RUN npm run build
FROM python:3.10-slim
WORKDIR /app
RUN apt-get update && apt-get install -y \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
mv /root/.local/bin/uv /usr/local/bin/uv && \
mv /root/.local/bin/uvx /usr/local/bin/uvx
COPY . .
RUN uv sync --frozen --no-editable
COPY --from=frontend-builder /app/frontend/dist ./static
ENV PATH="/app/.venv/bin:$PATH"
ENV PYTHONPATH=/app:/app/openenv_env:/app/rl
ENV PORT=7860
EXPOSE 7860
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:7860/ || exit 1
# Start FastAPI and serve everything
CMD ["sh", "-c", "python -u inference.py & uvicorn backend.api.main:app --host 0.0.0.0 --port 7860"] |