Dockerfile 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. FROM node:21.7.2-bookworm-slim as frontend-builder
  2. WORKDIR /app
  3. COPY ./frontend/package.json frontend/package-lock.json ./
  4. RUN npm install -g npm@10.5.1
  5. RUN npm install
  6. COPY ./frontend ./
  7. RUN npm run make-i18n && npm run build
  8. FROM python:3.12-slim as backend-builder
  9. WORKDIR /app
  10. ENV PYTHONPATH '/app'
  11. ENV POETRY_NO_INTERACTION=1 \
  12. POETRY_VIRTUALENVS_IN_PROJECT=1 \
  13. POETRY_VIRTUALENVS_CREATE=1 \
  14. POETRY_CACHE_DIR=/tmp/poetry_cache
  15. RUN apt-get update -y \
  16. && apt-get install -y curl make git build-essential \
  17. && python3 -m pip install poetry==1.8.2 --break-system-packages
  18. COPY ./pyproject.toml ./poetry.lock ./
  19. RUN touch README.md
  20. RUN poetry install --without evaluation --no-root && rm -rf $POETRY_CACHE_DIR
  21. FROM python:3.12-slim as runtime
  22. WORKDIR /app
  23. ENV RUN_AS_DEVIN=false
  24. ENV USE_HOST_NETWORK=false
  25. ENV SSH_HOSTNAME=host.docker.internal
  26. ENV WORKSPACE_BASE=/opt/workspace_base
  27. RUN mkdir -p $WORKSPACE_BASE
  28. RUN apt-get update -y \
  29. && apt-get install -y curl ssh
  30. ENV VIRTUAL_ENV=/app/.venv \
  31. PATH="/app/.venv/bin:$PATH" \
  32. PYTHONPATH='/app'
  33. COPY --from=backend-builder ${VIRTUAL_ENV} ${VIRTUAL_ENV}
  34. COPY ./opendevin ./opendevin
  35. COPY ./agenthub ./agenthub
  36. RUN python opendevin/download.py # No-op to download assets
  37. RUN playwright install --with-deps chromium
  38. COPY --from=frontend-builder /app/dist ./frontend/dist
  39. CMD ["uvicorn", "opendevin.server.listen:app", "--host", "0.0.0.0", "--port", "3000"]