|
|
|
ARG BUILD_TYPE=dev |
|
|
|
|
|
FROM python:3.10-slim AS autogpt-base |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
chromium-driver ca-certificates gcc \ |
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
curl jq wget git \ |
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
ENV PIP_NO_CACHE_DIR=yes \ |
|
PYTHONUNBUFFERED=1 \ |
|
PYTHONDONTWRITEBYTECODE=1 \ |
|
POETRY_HOME="/opt/poetry" \ |
|
POETRY_VIRTUALENVS_PATH="/venv" \ |
|
POETRY_VIRTUALENVS_IN_PROJECT=0 \ |
|
POETRY_NO_INTERACTION=1 |
|
|
|
|
|
RUN curl -sSL https://install.python-poetry.org | python3 - |
|
ENV PATH="$POETRY_HOME/bin:$PATH" |
|
RUN poetry config installer.max-workers 10 |
|
|
|
WORKDIR /app/autogpt |
|
COPY autogpt/pyproject.toml autogpt/poetry.lock ./ |
|
|
|
|
|
COPY forge/ ../forge |
|
|
|
|
|
COPY frontend/ ../frontend |
|
|
|
|
|
ENTRYPOINT ["poetry", "run", "autogpt"] |
|
CMD [] |
|
|
|
|
|
FROM autogpt-base as autogpt-dev |
|
RUN poetry install --no-cache --no-root \ |
|
&& rm -rf $(poetry env info --path)/src |
|
ONBUILD COPY autogpt/ ./ |
|
|
|
|
|
FROM autogpt-base as autogpt-release |
|
RUN poetry install --no-cache --no-root --without dev \ |
|
&& rm -rf $(poetry env info --path)/src |
|
ONBUILD COPY autogpt/autogpt/ ./autogpt |
|
ONBUILD COPY autogpt/scripts/ ./scripts |
|
ONBUILD COPY autogpt/plugins/ ./plugins |
|
ONBUILD COPY autogpt/README.md ./README.md |
|
ONBUILD RUN mkdir ./data |
|
|
|
FROM autogpt-${BUILD_TYPE} AS autogpt |
|
RUN poetry install --only-root |
|
|