Skip to content

Add docker-compose.local.yml for native arm64 dev builds#874

Open
paynejd wants to merge 1 commit into
masterfrom
feat/arm64-native-build-override
Open

Add docker-compose.local.yml for native arm64 dev builds#874
paynejd wants to merge 1 commit into
masterfrom
feat/arm64-native-build-override

Conversation

@paynejd
Copy link
Copy Markdown
Member

@paynejd paynejd commented May 25, 2026

Summary

  • New opt-in docker-compose.local.yml that adds build: . to the api service so arm64 dev hosts (Apple Silicon, arm64 Linux) compile the image locally from python:3.12-slim instead of running the amd64 published image under Rosetta/QEMU
  • README section documenting when to use it
  • Production / CI behavior unchanged (base docker-compose.yml untouched)

Why

Closes OpenConceptLab/ocl_issues#2538. The published openconceptlab/oclapi2:production is amd64-only. On Apple Silicon under OrbStack / Docker Desktop, post-restart Celery indexing saturates emulated cores hard enough to block the API for 10–60s on most requests.

Measured on an M4 MacBook (24 GB):

Operation amd64 emulated arm64 native (this PR)
GET /orgs/ 10s timeout ~20 ms
POST /concepts/ 60s timeout ~280 ms

Discovered while standing up a local oclapi2 + FHIRsmith demo — without this fix the stack was effectively unusable on Apple Silicon.

Design notes

  • Adds build: only on the api service; the other 8 services that share the openconceptlab/oclapi2:${ENVIRONMENT-production} image tag pick up the locally-tagged image automatically.
  • Mirrors the existing opt-in pattern from docker-compose.sso.yml (invoked via -f) rather than re-introducing docker-compose.override.yml (which the repo previously took out of auto-load, now .bak).
  • Docker compose will only build on first run — existing arm64 users with the amd64 image already cached can do a one-time docker compose -f docker-compose.yml -f docker-compose.local.yml build api (also called out in the README).

Test plan

  • docker compose -f docker-compose.yml -f docker-compose.local.yml config parses cleanly; api shows the merged build: block
  • First-time docker compose -f docker-compose.yml -f docker-compose.local.yml up -d on M4 builds image as arm64/linux (verified with docker image inspect)
  • All 13 services come up healthy after native build; GET /orgs/, POST /concepts/, /fhir/metadata all serve in <300ms
  • amd64 dev verifying that running with the override still does the right thing (cached image reused; no unnecessary rebuild)

Longer-term suggestion

Publishing multi-arch images via docker buildx --platform linux/amd64,linux/arm64 in CI would remove the need for this override entirely. Worth a separate ticket.

🤖 Generated with Claude Code

…ive arm64 dev builds

The published openconceptlab/oclapi2 images are amd64-only. On Apple
Silicon and other arm64 hosts they run under Rosetta/QEMU emulation,
and Celery's post-restart indexing saturates emulated cores hard
enough to block the API for tens of seconds. Adds an opt-in compose
override (mirroring the existing docker-compose.sso.yml pattern) that
attaches build: . to the api service so the image gets compiled from
the local Dockerfile against the host architecture. The other 8
services that share the same image tag pick up the locally-built
image automatically.

Measured on M4 MacBook + OrbStack: GET /orgs/ 10s timeout to ~20ms,
POST /concepts/ 60s timeout to ~280ms.

Production / CI behavior unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@paynejd paynejd requested a review from snyaggarwal May 25, 2026 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oclapi2: add docker-compose.local.yml for native arm64 dev builds on Apple Silicon

1 participant