| 123456789101112131415161718192021222324252627282930313233343536373839 |
- # Stage 1: build frontend
- FROM node:20-alpine AS web-builder
- WORKDIR /app/web
- COPY web/package.json web/package-lock.json ./
- RUN npm ci
- COPY web/ ./
- RUN npm run build
- # Stage 2: Python runtime
- FROM python:3.11-slim
- WORKDIR /app
- ENV PYTHONUNBUFFERED=1 \
- PYTHONDONTWRITEBYTECODE=1 \
- PIP_NO_CACHE_DIR=1 \
- PIP_DISABLE_PIP_VERSION_CHECK=1
- RUN apt-get update \
- && apt-get install -y --no-install-recommends gcc \
- && rm -rf /var/lib/apt/lists/*
- COPY pyproject.toml requirements.txt README.md ./
- COPY supply_agent/ supply_agent/
- COPY supply_infra/ supply_infra/
- COPY agents/ agents/
- COPY api/ api/
- COPY jobs/ jobs/
- RUN pip install ".[odps]"
- COPY --from=web-builder /app/web/dist ./web/dist
- EXPOSE 8080
- CMD ["python", "-m", "api"]
|