tulip
tulip copied to clipboard
Define services in config and add Docker workflow
This PR makes two additions:
- Services are defined via the config instead of code. This works by adding two environment variables:
VM_IPandTULIP_SERVICES_PATH. TheTULIP_SERVICES_PATHvariable specifies the path to a JSON file with the services. - Adds a GitHub workflow to build and publish each Docker image, removing the need to build the images on the deployment machine.
This PR publishes the Docker images to the GitHub Container Registry, not Docker Hub. My use case used GHCR, but feel free to adjust the workflow to your needs.
If merging, make sure to change the image links in the docker-compose.prod.yml file from ghcr.io/iamsilk to ghcr.io/OpenAttackDefenseTools.
This is great, you can make it cleaner by just putting the json data into the .env file:
# The services and ports
SERVICES_JSON='[
{
"port": 9876,
"name": "cc_market"
},
{
"port": 80,
"name": "maze"
},
{
"port": 8080,
"name": "scadent"
},
{
"port": 5000,
"name": "starchaser"
},
{
"port": 1883,
"name": "scadnet_bin"
},
{
"port": -1,
"name": "other"
}
]'