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.yml
anddocker-compose-dev.yml
files - 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-compose
files uses theexpose
directive to indicate which ports its providing - Add the service to the
depends_on
section of thenginx-proxy
service in thedocker-compose
files - Modify the configuration of the
nginx-proxy
container (in [nginx/nginx.conf
]({{ site.github.repository_url }}/blob/{{ site.github.build_revision }}/nginx/nginx.conf)) to defineupstream
andlocation
directives 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.