Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ The new and improved OCL terminology service v2
3. Go to http://localhost:8000/swagger/ to benefit.
4. Go to http://localhost:8080 for keyCloak.

### Dev Setup on Apple Silicon / arm64
The published `openconceptlab/oclapi2` Docker images are amd64-only. On arm64 hosts (Apple M-series Macs, arm64 Linux) they run under Rosetta/QEMU emulation, and under load — especially Celery's post-restart indexing — the emulated cores saturate hard enough to block the API for tens of seconds. Use the local-build override to compile from the local Dockerfile instead:
1. `sysctl -w vm.max_map_count=262144` #required by Elasticsearch (no-op on Docker Desktop / OrbStack)
2. `docker compose -f docker-compose.yml -f docker-compose.local.yml up -d`
3. Go to http://localhost:8000/swagger/ to benefit.

If you previously pulled the amd64 image and have it cached, force a one-time rebuild before step 2: `docker compose -f docker-compose.yml -f docker-compose.local.yml build api`.

### Configuration
#### Authentication
OCL API supports authentication using 2 methods. One is Django Auth (integrated into API) and the other is SSO using external service supporting OpenID such as Keycloak, Active Directory, etc.
Expand Down
23 changes: 23 additions & 0 deletions docker-compose.local.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Opt-in override for local native builds on arm64 hosts (Apple Silicon Macs,
# arm64 Linux). The published openconceptlab/oclapi2 images are amd64-only;
# on arm64 they run under Rosetta/QEMU emulation, and once Celery indexing
# kicks in the emulated cores saturate hard enough to block the API for
# tens of seconds at a time. Building from the local Dockerfile (which uses
# python:3.12-slim, a multi-arch base) gives a native image and ~200x faster
# requests in practice.
#
# Usage:
# docker compose -f docker-compose.yml -f docker-compose.local.yml up -d
#
# If you previously pulled the amd64 image, force a one-time rebuild:
# docker compose -f docker-compose.yml -f docker-compose.local.yml build api
#
# The api service is the only one that needs `build:` — all other services
# that share the openconceptlab/oclapi2 image tag will reuse the locally-
# built image once it exists.

services:
api:
build:
context: .
dockerfile: Dockerfile