build: update Dockerfile to avoid long rebuilds for code updated, add docker-compose.yml

- Avoid rebuilding all the steps by installing requirements depending on
  the requirement files only first.
  Use actual application code as a reference in the last Dockerfile layer.
- Add docker-compose.yml to make running easier.
This commit is contained in:
MDW 2025-05-11 13:52:47 +02:00
parent 2c4a126093
commit b302c4d962
No known key found for this signature in database
2 changed files with 117 additions and 80 deletions

21
docker-compose.yml Normal file
View 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