icapps/docker_qrdecode
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
=== Docker QR Decode ===
Simple microservice that takes an image and returns the decoded information.
Supports image formats and pdfs. PDFs need to have the .pdf extension
The server is implemented with NodeJS and Express.
The heavy lifting is performed by linux processes: imagemagick, zbar and poppler-utils
The image is based on node:16-alpine
When built the image is 278MB, when compressed: 91MB
Example consumer:
curl -X POST -H "Content-Type: multipart/form-data" -F "data=@test/1.png" http://localhost:3000/qrdecode
Example output:
{"1.png":"Hello world!"}
The image also exposes /info, /health and /metrics endpoints.
These can be used to do liveness checks.
Example:
curl http://localhost:3000/health
Response:
{"status":"UP"}
To build the docker image:
sudo docker build . -t qrdecode
To run the docker image:
sudo docker run -p 3000:3000 qrdecode
To save the docker image:
docker save qrdecode -o qrdecode
To zip the docker image for shipping:
gzip -9 qrdecode