A new service can be added to Malcolm by following the following steps:
- Create a new subdirectory for the service (under the Malcolm working copy base directory) containing whatever source or configuration files are necessary to build and run the service
- Create the service's Dockerfile in the [Dockerfiles]({{ site.github.repository_url }}/blob/{{ site.github.build_revision }}/Dockerfiles) directory of the Malcolm working copy
- Add a new section for the service under
services:in thedocker-compose.ymlanddocker-compose-dev.ymlfiles - To enable automatic builds for the service on GitHub, create a new [workflow]({{ site.github.repository_url }}/tree/{{ site.github.build_revision }}/.github/workflows/), using an existing workflow as an example
If the new service needs to expose a web interface to the user:
- Ensure the service's section in the
docker-composefiles uses theexposedirective to indicate which ports its providing - Add the service to the
depends_onsection of thenginx-proxyservice in thedocker-composefiles - Modify the configuration of the
nginx-proxycontainer (in [nginx/nginx.conf]({{ site.github.repository_url }}/blob/{{ site.github.build_revision }}/nginx/nginx.conf)) to defineupstreamandlocationdirectives to point to the service
Avoid publishing ports directly from the container to the host machine's network interface if at all possible. The nginx-proxy container handles encryption and authentication and should sit in front of any user-facing interface provided by Malcolm.