2023-04-14 02:47:28 +00:00
|
|
|
# Use an official Python base image from the Docker Hub
|
2023-04-11 12:04:37 +00:00
|
|
|
FROM python:3.11-slim
|
2023-04-14 02:47:28 +00:00
|
|
|
|
2023-04-14 02:36:47 +00:00
|
|
|
# Install git
|
|
|
|
RUN apt-get -y update
|
|
|
|
RUN apt-get -y install git
|
2023-04-16 11:25:04 +00:00
|
|
|
RUN apt-get install -y libglib2.0 libnss3 libgconf-2-4 libfontconfig1 chromium-driver
|
2023-04-14 02:36:47 +00:00
|
|
|
|
2023-04-14 02:47:28 +00:00
|
|
|
# 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
|
2023-04-15 13:59:14 +00:00
|
|
|
COPY --chown=appuser:appuser requirements-docker.txt .
|
|
|
|
RUN pip install --no-cache-dir --user -r requirements-docker.txt
|
2023-04-14 02:47:28 +00:00
|
|
|
|
|
|
|
# Copy the application files
|
2023-04-15 13:59:14 +00:00
|
|
|
COPY --chown=appuser:appuser autogpt/ ./autogpt
|
2023-04-14 02:47:28 +00:00
|
|
|
|
|
|
|
# Set the entrypoint
|
2023-04-16 11:25:04 +00:00
|
|
|
ENTRYPOINT ["python", "-m", "autogpt", "--debug"]
|