Crates.io | doppler-swarm |
lib.rs | doppler-swarm |
version | 0.4.5 |
source | src |
created_at | 2024-01-03 22:16:50.949058 |
updated_at | 2024-02-14 04:08:43.756238 |
description | Watch for changes in Doppler and update your Docker Swarm services. |
homepage | https://github.com/whopio/doppler-swarm/ |
repository | |
max_upload_size | |
id | 1087866 |
size | 75,823 |
Automate synchronization of Docker Swarm services with Doppler.
If you use Docker Swarm, you may have encountered the need to store your configuration somewhere and gracefully restart your services when configuration changes. We use Doppler. Unfortunately, Doppler doesn't offer native support for Docker Swarm out of the box. This tool bridges that gap by providing a seamless integration between Docker Swarm and Doppler.
This tool uses a specific Doppler API that enables it to subscribe to configuration changes. Please note that this API is available on Team and Enterprise plans only. For more details, refer to the Doppler documentation on automatic restart.
Please, take into account that this tool rewrites your docker service env vars completely. Do not add any env var to your docker service manually since they will be rewritten.
Setup alerts on errors in logs. Configuration is important.
config.json
with Doppler tokens and Docker service names. Take a look at example configuration. watcher is a single process that subscribes to Doppler and listens for changes in environment.config.json
on one of your docker swarm manager hosts somewhere (for example, at /etc/doppler-swarm/config.json
).myhostname1
with the actual hostname):
docker service create \
--user root \
--mount type=bind,source=/etc/doppler-swarm/config.json,target=/app/config.json \
--mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \
--name doppler-swarm \
--constraint "node.role==manager" \
--constraint "node.hostname==myhostname1" \
whop/doppler-swarm:latest \
/app/doppler-swarm /app/config.json
Ensure that the service is started by a user with write access to /var/run/docker.sock.docker service logs doppler-swarm
Feel free to create a new issue if you have suggestions, found any errors, or need assistance.
Come join us :)