feat: Build Paperclip from source instead of published image

- Create playbooks/build_paperclip_image.yml to build image locally from repo
- Clone/update paperclipai/paperclip main branch on deploy host
- Build with --target production for lean, current, self-managed image
- Update docker-compose to use paperclip-local:latest instead of reeoss image
- Gives full control over Paperclip version and dependency updates
- OpenCode v1.2.24 local adapter pre-installed in source build
- Enables rapid iteration and custom patches on Paperclip platform

Deployment flow:
1. ansible-playbook playbooks/build_paperclip_image.yml  # Build from source
2. ansible-playbook playbooks/deploy_paperclip_stack.yml # Deploy with local image
This commit is contained in:
rblundon committed 2026-09-27 20:13:02 -05:00
1 parent 6112b6daea
commit d368c92055
2 files changed
+41 -1

No files matched your search

@@ -0,0 +1,40 @@
---
- name: Build Paperclip Docker image from source
hosts: illuminations
become: true
vars:
paperclip_repo_dir: /opt/paperclip-repo
paperclip_image_name: paperclip-local
paperclip_image_tag: latest
tasks:
- name: Install git (if not present)
apt:
name: git
state: present
- name: Clone or update Paperclip repository
git:
repo: https://github.com/paperclipai/paperclip.git
dest: "{{ paperclip_repo_dir }}"
update: yes
register: git_clone
- name: Build Paperclip Docker image
shell: |
cd {{ paperclip_repo_dir }}
docker build --target production -t {{ paperclip_image_name }}:{{ paperclip_image_tag }} .
register: docker_build
changed_when: "'Successfully tagged' in docker_build.stdout"
- name: Show build result
debug:
msg: "Built image: {{ paperclip_image_name }}:{{ paperclip_image_tag }}"
- name: Show image details
shell: docker images {{ paperclip_image_name }}:{{ paperclip_image_tag }}
register: image_info
- name: Image info
debug:
msg: "{{ image_info.stdout_lines }}"
@@ -17,7 +17,7 @@ services:
retries: 5 retries: 5
paperclip: paperclip:
image: reeoss/paperclipai-paperclip:latest image: paperclip-local:latest
container_name: paperclip container_name: paperclip
network_mode: host network_mode: host
env_file: env_file: