Minimal Docker Compose setup for running a Readium LCP server (EDRLab) alongside a file encrypter for the LCP encryption format.
The LCP server handles DRM and license distribution. The encrypter encrypts EPUB/PDF files by making proper Readium LCP POST requests to the server.
Pull repo:
git clone https://github.com/zachjesus/docker-compose-lcp-server.git
cd docker-compose-lcp-serverRun with Docker Compose:
docker compose up --build-
lcp-server
- Readium LCP Server (EDRLab)
- Runs on port
8081 - Internal Docker URL:
http://lcp-server:8081
-
asset-encrypter
- Watches a directory for assets
- Encrypts files via the LCP server
- Outputs encrypted assets
assets-dataassets-encrypted
Minimal example of encrypting an EPUB using the Readium LCP server.
mv book.epub /{WATCH_DIR} # defined in the docker compose file update to your choosingcurl -X POST http://lcp-server:8081/encrypt \
-H "Content-Type: application/json" \
-d '{
"content": {
"location": "/assets/book.epub",
"type": "application/epub+zip"
},
"profile": "basic"
}'- Local/dev only
- Uses test certificates
- LCP server based on: https://github.com/readium/readium-lcp-server