Dockerfile 754 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Stage 1: build frontend
  2. FROM node:20-alpine AS web-builder
  3. WORKDIR /app/web
  4. COPY web/package.json web/package-lock.json ./
  5. RUN npm ci
  6. COPY web/ ./
  7. RUN npm run build
  8. # Stage 2: Python runtime
  9. FROM python:3.11-slim
  10. WORKDIR /app
  11. ENV PYTHONUNBUFFERED=1 \
  12. PYTHONDONTWRITEBYTECODE=1 \
  13. PIP_NO_CACHE_DIR=1 \
  14. PIP_DISABLE_PIP_VERSION_CHECK=1
  15. RUN apt-get update \
  16. && apt-get install -y --no-install-recommends gcc \
  17. && rm -rf /var/lib/apt/lists/*
  18. COPY pyproject.toml requirements.txt README.md ./
  19. COPY supply_agent/ supply_agent/
  20. COPY supply_infra/ supply_infra/
  21. COPY agents/ agents/
  22. COPY api/ api/
  23. COPY jobs/ jobs/
  24. RUN pip install ".[odps]"
  25. COPY --from=web-builder /app/web/dist ./web/dist
  26. EXPOSE 8080
  27. CMD ["python", "-m", "api"]