test_AI_Agent / Dockerfile
SarahXia0405's picture
Create Dockerfile
09f9bba verified
raw
history blame
717 Bytes
FROM python:3.11-slim
# ---- system deps (node for Vite build) ----
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get update && apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# ---- Python deps ----
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
# ---- Copy source ----
COPY api/ /app/api/
COPY web/ /app/web/
# ---- Build React ----
WORKDIR /app/web
RUN npm install
RUN npm run build
# ---- Run API (serves web dist too) ----
WORKDIR /app
ENV PORT=7860
CMD ["uvicorn", "api.server:app", "--host", "0.0.0.0", "--port", "7860"]