Skip to content

dickwolff/Docker-Pull-Stats

Docker Pull Stats

Github-sponsors   BuyMeACoffee

A simple webapp that pulls statistics from Docker Hub every night.

Currently it only stores the pull_count for each date. Please note that the app cannot get historical data from Docker Hub. It will create its own history from the first time the cron job runs.

Tech stack

  • Next.js for the webapp/api
  • Vercel for hosting the app and the PostgreSQL database

How to deploy

One click deploy via Vercel

Deploy with Vercel

Manual deployment

  1. Fork this repository
  2. Go to Vercel and click on 'Add new project' and import the repository from Git
  3. Enter the ENV variables listed in the table below
  4. After creating your project, go to 'Storage' and click 'Create Database' (use Postgres)
  5. Redeploy the app from Vercel (as the newly added Postgres environment variables aren't propagated yet)

Variables

Variable Description Required (y/n)
APP_NAME Your app name Yes
DOCKER_ENDPOINT Docker Hub API endpoint, eg. https://hub.docker.com/v2/repositories/dickwolff/export-to-ghostfolio Yes
CRON_SECRET Enter a secret of your own, used to safely run the CRON job Yes
TELEGRAM_BOT_TOKEN1 Telegram Bot token, if you want nighly updates in Telegram No
TELEGRAM_BOT_CHAT_ID Telegram chat id, if you want nighly updates in Telegram No

Footnotes

  1. Use the Telegram bot instructions to obtain the Telegram token and chatId.