Install With Docker Compose
Install Blur and Snapshot onPremise using Docker Compose
#
InstallInstall Docker and Docker Compose
Create a folder with a file named
docker-compose.yml
with the following content.docker-compose.ymlversion: "3.9" x-logging: &default-logging driver: "json-file" options: max-size: "100m" max-file: "5" mode: non-blocking services: snapshot_sdk: image: platerecognizer/alpr environment: - TOKEN=${SNAPSHOT_SDK_TOKEN} - LICENSE_KEY=${SNAPSHOT_SDK_LICENSE_KEY} volumes: - snapshot_license:/license logging: *default-logging healthcheck: test: [ "CMD", "curl", "-f", "http://localhost:8080/info" ] interval: 5s timeout: 2s retries: 10 skew_correction: image: platerecognizer/skew-correction environment: - LOGGING=${LOGGING} - SDK_URL=http://snapshot_sdk:8080 - BLUR=1 - TOKEN=${SNAPSHOT_SDK_TOKEN} - LICENSE_KEY=${SNAPSHOT_SDK_LICENSE_KEY} depends_on: snapshot_sdk: condition: service_healthy logging: *default-logging volumes: - ${IMAGES_DIR}:/images ports: - "8001:8001"volumes: snapshot_license:
Create a folder with a file named
.env
with the following contents..envCOMPOSE_PROJECT_NAME=blurSNAPSHOT_SDK_TOKEN=4805bee1222ce85e0b#####################SNAPSHOT_SDK_LICENSE_KEY=6xD#####LOGGING=INFO # CLIIMAGES_DIR=/tmp/samples# APISERVER=1
#
UpgradeOpen a terminal in the folder with the compose file and run the following commands:
docker compose pulldocker compose restart
#
RunBlur provides different modes of usage, first pull the images by running the command below in the folder with compose file:
docker compose pull
#
CLI Mode- Update
IMAGES_DIR
with the path to your images in the.env
file - Comment out the line
SERVER=1
in the.env
- Start the services using the following command:
docker compose up skew_correction
#
API Mode- Ensure the line
SERVER=1
in the.env
is not commented out - Comment out volumes from skew_correction service in
docker-compose.yml
, After comments:docker-compose.ymllogging: *default-logging# volumes:# - ${IMAGES_DIR}:/imagesports: - "8001:8001"
- Start the services using the following command:
docker compose up # To start services in the background add -d option after up
- The REST API will be listening on port 8001