Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
parkpow
GitHub Repository: parkpow/deep-license-plate-recognition
Path: blob/master/docker/dd-extension/README.md
1088 views

Plate Recognizer Installer

Plate Recognizer Installer Docker extension.

This extension is composed of:

  • A frontend app in React.

  • A backend container that runs an API in Python. Makes request to verify token

Local development

You can use docker to build, install and push your extension. Also, we provide an opinionated Makefile that could be convenient for you. There isn't a strong preference of using one over the other, so just use the one you're most comfortable with.

To build the extension, use make build-extension or:

docker buildx build -t platerecognizer/installer:latest . --load

To install the extension, use make install-extension or:

docker extension install platerecognizer/installer:latest

To Publish

docker buildx build --push --platform=linux/amd64,linux/arm64 --tag=platerecognizer/installer:0.0.1 .

If you want to automate this command, use the -f or --force flag to accept the warning message.

To preview the extension in Docker Desktop, open Docker Dashboard once the installation is complete. The left-hand menu displays a new tab with the name of your extension. You can also use docker extension ls to see that the extension has been installed successfully.

Frontend development

During the development of the frontend part, it's helpful to use hot reloading to test your changes without rebuilding your entire extension. To do this, you can configure Docker Desktop to load your UI from a development server. Assuming your app runs on the default port, start your UI app and then run:

cd ui npm install npm run dev

This starts a development server that listens on port 3000.

You can now tell Docker Desktop to use this as the frontend source. In another terminal run:

docker extension dev ui-source platerecognizer/installer:latest http://localhost:3000

In order to open the Chrome Dev Tools for your extension when you click on the extension tab, run:

docker extension dev debug platerecognizer/installer:latest

Each subsequent click on the extension tab will also open Chrome Dev Tools. To stop this behaviour, run:

docker extension dev reset platerecognizer/installer:latest

Backend development

Whenever you make changes in the backend source code, you will need to compile them and re-deploy a new version of your backend container. Use the docker extension update command to remove and re-install the extension automatically:

docker extension update platerecognizer/installer:latest

If you want to automate this command, use the -f or --force flag to accept the warning message.

Extension containers are hidden from the Docker Dashboard by default. You can change this in Settings > Extensions > Show Docker Extensions system containers.

Clean up

To remove the extension:

docker extension rm platerecognizer/installer:latest

What's next?