Customizing System Setup in the Container
Copy Source and Versionize Locally
A temporary container is created for each image (adjust the version to your own status), the corresponding source directories are extracted, and the container is then deleted again.
It is advisable to versionize the directories using a suitable tool such as Git.
Customizing Image
container_id=$(docker create registry.planta.services/project/customizing:DB26)
docker cp $container_id:psc/src/Python/ ./Customizing/Python/
docker cp $container_id:psc/src/jython/ ./Customizing/jython/
docker cp $container_id:psc/src/config/ ./Customizing/config/
docker cp $container_id:psc/src/DefaultPicture/ ./DefaultPicture/
docker rm $container_id
Manager Image
container_id=$(docker create registry.planta.services/project/manager:S38)
docker cp $container_id:/planta/jython/ ./manager/jython/
docker rm $container_id
Worker Image
container_id=$(docker create registry.planta.services/project/worker:S38)
docker cp $container_id:/planta/py/ ./worker/Python/
docker rm $container_id
Development System Setup
First, a normal Docker Compose template with a customized image must be started so that the system installs itself with the default data.
Afterwards, the Docker Compose must be adjusted and all references to the customizing image must be removed.
Subsequently, the source directories from the 1st step can be mounted locally.
It is assumed that the directories are located in the same folder as the Docker Compose file.
Manager
volumes:
- ./Customizing/config:/mnt/transfer/config:rw
- ./Customizing/Python:/mnt/transfer/Python:rw
- ./Customizing/jython:/mnt/transfer/jython:rw
- ./Customizing/DefaultPicture:/mnt/transfer/DefaultPicture:rw
- ./manager/jython/server:/planta/jython/server:rw
- ./manager/jython/__init__.py:/planta/jython/__init__.py:rw
Worker
volumes:
- ./Customizing/config:/mnt/transfer/config:rw
- ./Customizing/Python:/mnt/transfer/Python:rw
- ./Customizing/jython:/mnt/transfer/jython:rw
- ./Customizing/DefaultPicture:/mnt/transfer/DefaultPicture:rw
- ./worker/Python/py/api/ppms/server/csrpc:/planta/py/api/ppms/server/csrpc:rw
- ./worker/Python/py/api/ppms/server/ppms:/planta/py/api/ppms/server/ppms:rw
- ./worker/Python/py/api/ppms/server/tests:/planta/py/api/ppms/server/tests:rw
- ./worker/Python/py/api/ppms/server/__init__.py:/planta/py/api/ppms/server/__init__.py:rw
- ./worker/Python/py/api/ppms/server/planta.py:/planta/py/api/ppms/server/planta.py:rw
- ./worker/Python/py/folder_overlay_sync.py:/planta/py/folder_overlay_sync.py:rw
Build Your Own Customizing Image
Adjusted customizing Python files can be stored in a custom image. To do this, you create a new image based on the official customizing image.
Can be used for deployments in test and/or productive environments
Enables own versioning of artefacts and integration in deployment pipelines
Docker file example:
FROM registry.planta.services/planta/customizing:DB26
COPY /path/to/your/customizing /path/to/equivalent/path/in/container
## example, copying new individual test.py to customer python file location
# COPY test.py src/Python/py/customer/
## example, copying edited existing ppms.py to existing location
# COPY ppms.py src/Python/py/api/ppms/customizing/venus/ppms/
Once the above template has been customized, the new image can be built and deployed with Docker.
Individual Python files must be stored in the src/Python/py/customer/ directory.