mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 00:35:00 +00:00

The changes in this commit add support for running the Docker container as a non-root user. Specifically: - Set permissions on the /.aider and /app directories to allow read/write/execute access for all users. - Configure Git to consider the /app directory as a safe directory, which prevents Git from complaining about unusual permissions when running as a non-root user. - Ensure that the Python site-packages directory and other relevant directories have read/write/execute permissions for all users, so that pip installs work even when running as a non-root user. These changes will allow the Docker container to be run with the `--user` flag, which is a common requirement for running containers in production environments.
39 lines
1.1 KiB
Docker
39 lines
1.1 KiB
Docker
FROM python:3.10-slim AS base
|
|
|
|
RUN apt-get update && \
|
|
apt-get install --no-install-recommends -y build-essential git libportaudio2 && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN mkdir /.aider && chmod a+rwx /.aider
|
|
|
|
# So git doesn't complain about unusual permissions with `docker run --user xxx`
|
|
RUN mkdir /app && chmod a+rwx /app && git config --system --add safe.directory /app
|
|
|
|
# So pip installs work even with `docker run --user xxx`
|
|
RUN chmod a+rwx /usr/local/lib/python3.10/site-packages /usr/local/*
|
|
|
|
WORKDIR /app
|
|
|
|
#########################
|
|
FROM base AS aider-full
|
|
|
|
COPY . /aider
|
|
RUN pip install --upgrade pip \
|
|
&& pip install --no-cache-dir /aider[help,browser,playwright] \
|
|
--extra-index-url https://download.pytorch.org/whl/cpu \
|
|
&& rm -rf /aider
|
|
|
|
RUN playwright install --with-deps chromium
|
|
|
|
ENTRYPOINT ["aider"]
|
|
|
|
#########################
|
|
FROM base AS aider
|
|
|
|
COPY . /aider
|
|
RUN pip install --upgrade pip \
|
|
&& pip install --no-cache-dir /aider \
|
|
--extra-index-url https://download.pytorch.org/whl/cpu \
|
|
&& rm -rf /aider
|
|
|
|
ENTRYPOINT ["aider"]
|