An equivalent solution to Portainer BE's Automatic Stack Updates feature, but free.
Just run the container, tell it how to access your portainer instance, and tada, it's done! 🎉
# docker-compose.yml
services:
stack-webhook:
image: aklinker1/portainer-stack-webhook
ports:
- 3000:3000
environment:
BASE_URL: https://portainer.example.com/api # Required, full URL including /api
USERNAME: your-username # Required, username to login with
PASSWORD: your-password # Required, password to login with
PORT: 3000 # Optional, default 3000
To tell Portainer to pull the latest images and update the stack, make a simple POST request:
curl -X POST http://localhost:3000/api/webhook/stacks/:stackId
Note
The stackId
can be retrieved from the URL when visiting the stack details in Portainer. In the URL below, it would be 22
from the id=22
query parameter.
https://portainer.example.com/#!/1/docker/stacks/some_stack?id=22&type=1®ular=true&external=false&orphaned=false
To install dependencies:
bun install
To run:
- Copy the
.env.template
to.env
and fill it out with your portainer instance's info:cp .env.template .env
- Start the server
bun dev
- Send a request to test it out
curl -X POST http://localhost:3000/api/webhook/stacks/123
You can also run tests:
bun test