Maintenance Window
Adding a configurable maintenance window for Appsmith’s auto-updates
Checking for updates can be configured to run during a pre-specific maintenance window by specifying a cron expression to the --schedule argument in the auto_update container’s command.

Changes required

Step 1

In the docker-compose.yml file, scroll to the configurations of the container with image containrrr/watchtower. It'll be named either auto_update or watchtower. This is what your configuration will look like
1
auto_update:
2
image: containrrr/watchtower
3
volumes:
4
- /var/run/docker.sock:/var/run/docker.sock
5
# Checks for update every 5 mins because of --interval
6
command: --interval 300 --label-enable --cleanup
7
networks:
8
- appsmith
9
restart: always
Copied!

Step 2

In the command configuration, please remove the --interval argument and the value 300 next to it, and in it’s place, add a --schedule and a cron expression defining an update interval of your choice. Your new configuration will look like below.
1
auto_update:
2
image: containrrr/watchtower
3
volumes:
4
- /var/run/docker.sock:/var/run/docker.sock
5
# Check for updates every hour because of the cron schedule
6
command: --schedule "0 0 * ? * *" --label-enable --cleanup
7
networks:
8
- appsmith
9
restart: always
Copied!
ℹ️ Note that a 6-value cron expression is expected here, not the traditional 5-value one. For details on how the expression works, please refer to (https://pkg.go.dev/github.com/robfig/[email protected]#hdr-CRON_Expression_Format)
After making the changes restart the auto update container via the command below:
1
# Use the container name as defined in your docker-compose.yml file. This command uses the name: auto_update
2
sudo docker-compose pull && sudo docker-compose up --force-recreate auto_update
Copied!
Check the logs and see that the maintenance window is now in effect.
1
docker-compose logs -f auto_update
Copied!

Example configurations for some common use cases

Check for updates every Sunday at 12:00:
1
command: --schedule "0 0 12 ? * SUN" --label-enable --cleanup
Copied!
Check for updates every hour:
1
command: --schedule "0 0 * ? * *" --label-enable --cleanup
Copied!
Check for updates once at 12:00 everyday:
1
command: --schedule "0 0 12 * * ?" --label-enable --cleanup
Copied!

References: