Learning Docker by creating a NodeRed-Docker to use Three.js in this NodeRed-Docker
Dependencies:
- Docker Installation
- Knowledge Usinge NodeRed
- Basic Knowledge in JavaScript
Docker Learning Sources:
Three.js Learning Sources
- https://threejs.org/docs/index.html#manual/en/introduction/Creating-a-scene
- https://threejs.org/manual/#en/fundamentals
Tools:
- Visual Studio Code with Docker extention
- Three.js Editor: https://threejs.org/editor/
Findings:
Docker
- Docker image, docker container and docker compose are diffrent things but connect together
- The image is the building plan, what software ist to install and what commands are to do, when a new container is build (command: docker build; file: Dockerfile)
- The container is the thing itself, it does what ever the image said to do and is ready to be used (command: docker run; here proviedes node-red as a service)
- Docker compose is the case when you want to have more containers work together and share the filespace (command: docker-compose up; file: docker-compose.yml; the usecase here is to link internal container direcories to external docker host directories)
- You do not neeed to build own images for everything, it is better to compose existing (offical) images from hub.docker.com to a composed one -> docker-compose
Node-Red
- To better code JavaScript to use it in Node-Red: Create a .js file on the Node-Red-Docker-Filesystem and use an external Editor and load the file with the file-block to use it, instead of the use of the script-block.