2023-04-14 02:47:28 +00:00
|
|
|
# Use an official Python base image from the Docker Hub
|
2023-04-18 23:27:29 +00:00
|
|
|
FROM python:3.10-slim
|
2023-04-14 02:47:28 +00:00
|
|
|
|
2023-04-24 13:27:53 +00:00
|
|
|
# 'dev' or 'release' container build
|
|
|
|
ARG BUILD_TYPE=dev
|
2023-04-14 02:36:47 +00:00
|
|
|
|
2023-04-24 13:27:53 +00:00
|
|
|
# Install browsers
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
chromium-driver firefox-esr \
|
|
|
|
ca-certificates
|
2023-04-15 21:37:50 +00:00
|
|
|
|
2023-04-24 13:27:53 +00:00
|
|
|
# Install utilities
|
|
|
|
RUN apt-get install -y curl jq wget git
|
2023-04-15 21:37:50 +00:00
|
|
|
|
2023-04-14 02:47:28 +00:00
|
|
|
# Set environment variables
|
|
|
|
ENV PIP_NO_CACHE_DIR=yes \
|
|
|
|
PYTHONUNBUFFERED=1 \
|
|
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
2023-04-24 13:27:53 +00:00
|
|
|
# Install the required python packages globally
|
|
|
|
ENV PATH="$PATH:/root/.local/bin"
|
|
|
|
COPY requirements.txt .
|
2023-04-14 02:47:28 +00:00
|
|
|
|
2023-04-24 13:27:53 +00:00
|
|
|
# Only install dev dependencies in dev container builds
|
|
|
|
RUN [ '${BUILD_TYPE}' = 'dev' ] || sed -i '/Items below this point will not be included in the Docker Image/,$d' requirements.txt && \
|
|
|
|
pip install --no-cache-dir -r requirements.txt
|
2023-04-14 02:47:28 +00:00
|
|
|
|
|
|
|
# Copy the application files
|
2023-04-24 13:27:53 +00:00
|
|
|
WORKDIR /app
|
|
|
|
COPY autogpt/ ./autogpt
|
2023-04-14 02:47:28 +00:00
|
|
|
|
|
|
|
# Set the entrypoint
|
2023-04-16 11:34:48 +00:00
|
|
|
ENTRYPOINT ["python", "-m", "autogpt"]
|