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:
PORTAINER_API_URL: https://portainer.example.com/api # Required, full URL including /api
PORTAINER_USERNAME: your-username # Required, username to login with
PORTAINER_PASSWORD: your-password # Required, password to login with
PORT: 3000 # Optional, default 3000
API_KEY: your-api-key # Optional, set to a any string to require authentication
LOG_LEVEL: json # Optional, control the log format ("pretty" | "json")To tell Portainer to pull the latest images and update the stack, make a simple POST request:
# No authentication
curl -X POST http://localhost:3000/api/webhook/stacks/:stackId
# With an API key
curl -X POST -H "X-API-Key: <your-api-key>" http://localhost:3000/api/webhook/stacks/:stackIdYou can get the stackId from the GET /api/stacks endpoint.
For other available APIs, see /scalar or copy-paste ./openapi.json into Scalar Editor
To install dependencies:
bun install@aklinker1/zeta docs: https://jsr.io/@aklinker1/zeta
To run:
- Copy the
.env.templateto.envand 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
To run tests:
bun test