mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-03 22:34:29 +01:00
This file needs to be maintained parallel to requirements.txt, but isn't, causes problems when new dependencies are introduced. Instead, derive the Docker dependencies from the stock ones. Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
29 lines
833 B
Docker
29 lines
833 B
Docker
# Use an official Python base image from the Docker Hub
|
|
FROM python:3.11-slim
|
|
|
|
# Install git
|
|
RUN apt-get -y update
|
|
RUN apt-get -y install git chromium-driver
|
|
|
|
# Set environment variables
|
|
ENV PIP_NO_CACHE_DIR=yes \
|
|
PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
# Create a non-root user and set permissions
|
|
RUN useradd --create-home appuser
|
|
WORKDIR /home/appuser
|
|
RUN chown appuser:appuser /home/appuser
|
|
USER appuser
|
|
|
|
# Copy the requirements.txt file and install the requirements
|
|
COPY --chown=appuser:appuser requirements.txt .
|
|
RUN sed -i '/Items below this point will not be included in the Docker Image/,$d' requirements.txt && \
|
|
pip install --no-cache-dir --user -r requirements.txt
|
|
|
|
# Copy the application files
|
|
COPY --chown=appuser:appuser autogpt/ ./autogpt
|
|
|
|
# Set the entrypoint
|
|
ENTRYPOINT ["python", "-m", "autogpt"]
|