Compose Generator - Update 1.5.0
Tags: docker, go, opensource, devops
Published: 2021-12-16 13:43:53

If you haven’t read about Compose Generator yet, visit the introduction article [here](https://dev.to/marcauberer/compose-generator-deploy-your-app-in-seconds-21o6). This particular article shows which features / improvements were added in version 1.5.0 of Compose Generator.

Apart from optimization and bugfixes, there are a few new features to discuss in the following parts.

## Watchtower integration
This update adds support for auto-updating of Docker images, using Watchtower. The requirement for that is, that the tag of the Docker image does not change with the update. If you set the tag `latest` you should be good to go!

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o1cvg0d0iblfm22r12aq.png)

Compose Generator asks you if you want to enable Watchtower after selecting the other service templates. It will ask you which services you want to enable Watchtower for. Any selected service will get the `com.centurylabs.watchtower.enable` label.

If Watchtower is enabled. The compose file contains an additional service:

```yml
companion-watchtower:
  command:
    - --interval
    - "30"
  depends_on:
    database-postgres:
      condition: service_started
    db-admin-adminer:
      condition: service_started
    frontend-accent:
      condition: service_started
    frontend-angular:
      condition: service_started
  image: containrrr/watchtower:latest
  restart: unless-stopped
  volumes:
    - type: bind
      source: /var/run/docker.sock
      target: /var/run/docker.sock
```

## Major performance optimization for CCom
Compose Generator internally uses the [CCom compiler toolchain](https://github.com/compose-generator/ccom) to evaluate conditional sections and conditional statements, based on JSON input. CCom offers a CLI, which Compose Generator called previously. This CLI executable enriches the user input and then calls the compiler executable with all required inputs. After the last update we executed several benchmarks for CCom, which have shown that this additional executable fork costs a lot of performance. <br>
As Compose Generator uses CCom very often (~20 times even if only one template was selected), CCom can be optimized quite a bit by calling the CCom compiler executable directly without going via the CLI.

## Further reading about Compose Generator
The key concept behind Compose Generator is, that it is durable and extensible. Therefore it is possible to create own predefined service templates and add them to the list of selectable services. If you do so, feel free to hand it in as a community contribution on GitHub!

There will be more upcoming articles regarding in-depth information about creating predefined service templates and all available cli subcommands!

---

Thank you for your interest and for reading this article.
If you want to learn more about Compose Generator, please visit the official documentation at [www.compose-generator.com](https://www.compose-generator.com) and the [open source project on GitHub](https://github.com/compose-generator/compose-generator).

Header image source: Photo by [Dominik Lückmann](https://unsplash.com/@exdigy) on [Unsplash](https://unsplash.com/)