mirror of
https://github.com/Aider-AI/aider.git
synced 2025-06-01 02:05:00 +00:00
Merge b302c4d962
into 3caab85931
This commit is contained in:
commit
e897817b0f
2 changed files with 117 additions and 80 deletions
21
docker-compose.yml
Normal file
21
docker-compose.yml
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
services:
|
||||||
|
# Run this using `docker compose run --rm aider-base` on the CLI
|
||||||
|
# To run with forced build: `docker compose run --build --rm aider-base` on the CLI
|
||||||
|
aider-base:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
args: [--rm]
|
||||||
|
dockerfile: docker/Dockerfile
|
||||||
|
container_name: aider
|
||||||
|
#volumes:
|
||||||
|
# - .:/app
|
||||||
|
#working_dir: /app
|
||||||
|
command: /bin/bash
|
||||||
|
|
||||||
|
# Run this using `docker compose run --rm aider` on the CLI
|
||||||
|
# You can add arguments: `docker compose run --rm aider --architect -m "Do this task"`
|
||||||
|
# And you can request to update the build: `docker compose run --build --rm aider` on the CLI
|
||||||
|
aider:
|
||||||
|
extends: aider-base
|
||||||
|
command: aider
|
||||||
|
|
|
@ -1,80 +1,96 @@
|
||||||
FROM python:3.10-slim AS base
|
FROM python:3.10-slim AS base
|
||||||
|
|
||||||
# Install system dependencies
|
# Install system dependencies
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install --no-install-recommends -y build-essential git libportaudio2 pandoc && \
|
apt-get install --no-install-recommends -y build-essential git libportaudio2 pandoc && \
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Create app user with UID 1000
|
# Create app user with UID 1000
|
||||||
RUN useradd -m -u 1000 -s /bin/bash appuser
|
RUN useradd -m -u 1000 -s /bin/bash appuser
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Create virtual environment
|
# Create virtual environment
|
||||||
RUN python -m venv /venv
|
RUN python -m venv /venv
|
||||||
ENV PATH="/venv/bin:$PATH"
|
ENV PATH="/venv/bin:$PATH"
|
||||||
|
|
||||||
# Playwright browser settings
|
# Playwright browser settings
|
||||||
ENV PLAYWRIGHT_BROWSERS_PATH=/home/appuser/pw-browsers
|
ENV PLAYWRIGHT_BROWSERS_PATH=/home/appuser/pw-browsers
|
||||||
ENV PLAYWRIGHT_SKIP_BROWSER_GC=1
|
ENV PLAYWRIGHT_SKIP_BROWSER_GC=1
|
||||||
|
|
||||||
# Create directories with proper permissions
|
# Create directories with proper permissions
|
||||||
RUN mkdir -p /home/appuser/.aider /home/appuser/.cache /home/appuser/pw-browsers && \
|
RUN mkdir -p /home/appuser/.aider /home/appuser/.cache /home/appuser/pw-browsers && \
|
||||||
chown -R appuser:appuser /home/appuser /app /venv && \
|
chown -R appuser:appuser /home/appuser /app /venv && \
|
||||||
chmod -R 777 /home/appuser/.aider /home/appuser/.cache /home/appuser/pw-browsers
|
chmod -R 777 /home/appuser/.aider /home/appuser/.cache /home/appuser/pw-browsers
|
||||||
|
|
||||||
# So git doesn't complain about unusual permissions
|
# So git doesn't complain about unusual permissions
|
||||||
RUN git config --system --add safe.directory /app
|
RUN git config --system --add safe.directory /app
|
||||||
|
|
||||||
# This puts the container's ~/.aider into the host's project directory (usually host's cwd).
|
# This puts the container's ~/.aider into the host's project directory (usually host's cwd).
|
||||||
# That way caches, version checks, etc get stored in the host filesystem not
|
# That way caches, version checks, etc get stored in the host filesystem not
|
||||||
# simply discarded every time the container exits.
|
# simply discarded every time the container exits.
|
||||||
ENV HOME=/app
|
ENV HOME=/app
|
||||||
|
|
||||||
#########################
|
#########################
|
||||||
FROM base AS aider-full
|
FROM base AS aider-full
|
||||||
|
|
||||||
ENV AIDER_DOCKER_IMAGE=paulgauthier/aider-full
|
ENV AIDER_DOCKER_IMAGE=paulgauthier/aider-full
|
||||||
|
|
||||||
COPY . /tmp/aider
|
# Copy requirements files
|
||||||
|
COPY requirements.txt /tmp/aider/
|
||||||
# Install dependencies as root
|
COPY requirements/ /tmp/aider/requirements/
|
||||||
RUN /venv/bin/python -m pip install --upgrade --no-cache-dir pip && \
|
|
||||||
/venv/bin/python -m pip install --no-cache-dir /tmp/aider[help,browser,playwright] boto3 \
|
# Install dependencies as root
|
||||||
--extra-index-url https://download.pytorch.org/whl/cpu && \
|
RUN /venv/bin/python -m pip install --upgrade --no-cache-dir pip && \
|
||||||
rm -rf /tmp/aider
|
/venv/bin/python -m pip install --no-cache-dir -r /tmp/aider/requirements.txt && \
|
||||||
|
rm -rf /tmp/aider
|
||||||
# Install playwright browsers
|
|
||||||
RUN /venv/bin/python -m playwright install --with-deps chromium
|
# Install playwright browsers
|
||||||
|
RUN /venv/bin/python -m pip install --no-cache-dir playwright && \
|
||||||
# Fix site-packages permissions
|
/venv/bin/python -m playwright install --with-deps chromium
|
||||||
RUN find /venv/lib/python3.10/site-packages \( -type d -exec chmod a+rwx {} + \) -o \( -type f -exec chmod a+rw {} + \)
|
|
||||||
|
# Fix site-packages permissions
|
||||||
# Switch to appuser
|
RUN find /venv/lib/python3.10/site-packages \( -type d -exec chmod a+rwx {} + \) -o \( -type f -exec chmod a+rw {} + \)
|
||||||
USER appuser
|
|
||||||
|
# Copy the rest of the application code
|
||||||
ENTRYPOINT ["/venv/bin/aider"]
|
COPY . /app/
|
||||||
|
|
||||||
#########################
|
# Install the application as a package
|
||||||
FROM base AS aider
|
RUN /venv/bin/python -m pip install .
|
||||||
|
|
||||||
ENV AIDER_DOCKER_IMAGE=paulgauthier/aider
|
# Switch to appuser
|
||||||
|
USER appuser
|
||||||
COPY . /tmp/aider
|
|
||||||
|
ENTRYPOINT ["/venv/bin/aider"]
|
||||||
# Install dependencies as root
|
|
||||||
RUN /venv/bin/python -m pip install --upgrade --no-cache-dir pip && \
|
#########################
|
||||||
/venv/bin/python -m pip install --no-cache-dir /tmp/aider[playwright] boto3 google-cloud-aiplatform \
|
FROM base AS aider
|
||||||
--extra-index-url https://download.pytorch.org/whl/cpu && \
|
|
||||||
rm -rf /tmp/aider
|
ENV AIDER_DOCKER_IMAGE=paulgauthier/aider
|
||||||
|
|
||||||
# Install playwright browsers
|
# Copy requirements files
|
||||||
RUN /venv/bin/python -m playwright install --with-deps chromium
|
COPY requirements.txt /tmp/aider/
|
||||||
|
COPY requirements/ /tmp/aider/requirements/
|
||||||
# Fix site-packages permissions
|
|
||||||
RUN find /venv/lib/python3.10/site-packages \( -type d -exec chmod a+rwx {} + \) -o \( -type f -exec chmod a+rw {} + \)
|
# Install dependencies as root
|
||||||
|
RUN /venv/bin/python -m pip install --upgrade --no-cache-dir pip && \
|
||||||
# Switch to appuser
|
/venv/bin/python -m pip install --no-cache-dir -r /tmp/aider/requirements.txt && \
|
||||||
USER appuser
|
rm -rf /tmp/aider
|
||||||
|
|
||||||
ENTRYPOINT ["/venv/bin/aider"]
|
# Install playwright browsers
|
||||||
|
RUN /venv/bin/python -m pip install --no-cache-dir playwright && \
|
||||||
|
/venv/bin/python -m playwright install --with-deps chromium
|
||||||
|
|
||||||
|
# Fix site-packages permissions
|
||||||
|
RUN find /venv/lib/python3.10/site-packages \( -type d -exec chmod a+rwx {} + \) -o \( -type f -exec chmod a+rw {} + \)
|
||||||
|
|
||||||
|
# Copy the rest of the application code
|
||||||
|
COPY . /app/
|
||||||
|
|
||||||
|
# Install the application as a package
|
||||||
|
RUN /venv/bin/python -m pip install .
|
||||||
|
|
||||||
|
# Switch to appuser
|
||||||
|
USER appuser
|
||||||
|
|
||||||
|
ENTRYPOINT ["/venv/bin/aider"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue