{"id":16098640,"url":"https://github.com/funnyzak/git-webhook-docker","last_synced_at":"2025-10-23T10:30:14.407Z","repository":{"id":61728661,"uuid":"257842887","full_name":"funnyzak/git-webhook-docker","owner":"funnyzak","description":"Pull your project git code into a data volume and trigger event via Webhook.","archived":true,"fork":false,"pushed_at":"2022-10-20T02:56:12.000Z","size":38,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T07:22:09.853Z","etag":null,"topics":["docker","git","git-webhook","go","java","nodejs","npm","python","webhook","yarn"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/funnyzak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-22T08:42:40.000Z","updated_at":"2023-05-18T05:40:18.000Z","dependencies_parsed_at":"2022-10-20T15:46:00.003Z","dependency_job_id":null,"html_url":"https://github.com/funnyzak/git-webhook-docker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgit-webhook-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgit-webhook-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgit-webhook-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/funnyzak%2Fgit-webhook-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/funnyzak","download_url":"https://codeload.github.com/funnyzak/git-webhook-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237807490,"owners_count":19369597,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","git","git-webhook","go","java","nodejs","npm","python","webhook","yarn"],"created_at":"2024-10-09T18:24:13.774Z","updated_at":"2025-10-23T10:30:14.029Z","avatar_url":"https://github.com/funnyzak.png","language":"Shell","readme":"# Git Webhook Docker\n\nPull your project git code into a data volume and trigger event via Webhook.\n\n[![Docker Stars](https://img.shields.io/docker/stars/funnyzak/git-webhook.svg?style=flat-square)](https://hub.docker.com/r/funnyzak/git-webhook/)\n[![Docker Pulls](https://img.shields.io/docker/pulls/funnyzak/git-webhook.svg?style=flat-square)](https://hub.docker.com/r/funnyzak/git-webhook/)\n\nThis image is based on Alpine Linux image, which is a 439MB image.\n\nDownload size of this image is:\n\n[![](https://images.microbadger.com/badges/image/funnyzak/git-webhook.svg)](http://microbadger.com/images/funnyzak/git-webhook)\n\n[Docker hub image: funnyzak/git-webhook](https://hub.docker.com/r/funnyzak/git-webhook)\n\nDocker Pull Command: `docker pull funnyzak/git-webhook`\n\nWebhook Url: [http://hostname:9000/hooks/git-webhook?token=HOOK_TOKEN](#)\n\n---\n\n## Main Modules\n\n* java 1.8\n* go 1.12.12\n* python 3.9\n* nodejs 10.19.0\n* npm 10.19.0\n* yarn 1.16.0\n* mvn 3.39\n* nginx 1.16.1\n* openssh 8.1\n* zip 3.0\n* unzip 6.0\n* tar 1.32\n* wget 1.20.3\n* curl 7.66\n* rsync 3.1.3\n* git 2.22\n* bash 5.0.0\n* webhook [Help](https://github.com/adnanh/webhook)\n\n### Other Modules\n\n* tzdata\n* fc-config\n* msttcorefonts\n* gcc\n* g++\n* make\n  \n---\n  \n## Available Parameters\n\nThe following flags are a list of all the currently supported options that can be changed by passing in the variables to docker with the -e flag.\n\n* **USE_HOOK** : The web hook is enabled as long as this is present.\n* **HOOK_TOKEN** : Custom hook security tokens, strings.\n* **GIT_REPO** : If it is a private repository, and is ssh link, set the private key file with the file name ***id_rsa*** must be set. If you use https link, you can also set this format link type: ***https://GIT_TOKEN@GIT_REPO***.\n* **GIT_BRANCH** : Select a branch for clone and auto hook match.\n* **GIT_EMAIL** : Set your email for git (required for git to work).\n* **GIT_NAME** : Set your name for git (required for git to work).\n* **STARTUP_COMMANDS** : Optional. Add any commands that will be run at the end of the start.sh script. left blank, will not execute.\n* **AFTER_PULL_COMMANDS** : Optional. Add any commands that will be run after pull. left blank, will not execute.\n* **BEFORE_PULL_COMMANDS** : Optional. Add any commands that will be run before pull. left blank, will not execute.\n* **AFTER_PACKAGE_COMMANDS** : Optional. Add any commands that will be run after package. left blank, will not execute.\n\n### Notify\n\n* **NOTIFY_ACTION_LABEL**: Optional. notify action name define. default : `StartUp|BeforePull|AfterPull|AfterPackage`\n* **NOTIFY_ACTION_LIST**: Optional. notify action list. included events will be notified. default : `BeforePull|AfterPackage`\n* **NOTIFY_URL_LIST** : Optional. Notify link array , each separated by **|**\n* **TELEGRAM_BOT_TOKEN**: Optional. telegram Bot Token-chatid setting. eg: **token###chatid|token2###chatid2**. each separated by **|** [Official Site](https://core.telegram.org/api).\n* **IFTTT_HOOK_URL_LIST** : Optional. ifttt webhook url array , each separated by **|** [Official Site](https://ifttt.com/maker_webhooks).\n* **DINGTALK_TOKEN_LIST**: Optional. DingTalk Bot TokenList, each separated by **|** [Official Site](http://www.dingtalk.com).\n* **JISHIDA_TOKEN_LIST**: Optional. JiShiDa TokenList, each separated by **|**. [Official Site](http://push.ijingniu.cn/admin/index/).\n* **APP_NAME** : Optional. When setting notify, it is best to set.\n\n---\n\n## Volume\n\n* **/app/code** : git source code dir. docker work dir.\n* **/root/.ssh** :  ssh key folder.\n* **/custom_scripts/on_startup** :  which the scripts are executed at startup, traversing all the scripts and executing them sequentially\n* **/custom_scripts/before_pull** :  which the scripts are executed at before pull\n* **/custom_scripts/after_pull** :  which the scripts are executed at after pull\n* **/custom_scripts/after_package** :  which the scripts are executed at after package.\n\n## ssh-keygen\n\n`ssh-keygen -t rsa -b 4096 -C \"youremail@gmail.com\" -N \"\" -f ./id_rsa`\n\n---\n\n## SendMessage\n\nYou can use notifications by call \"/app/scripts/utils.sh\" in the execution script.\n\n```bash\nsource /app/scripts/utils.sh;\n\nnotify_all \"hello world\"\n```\n\n---\n\n## Display Package Elapsed Time\n\nshow package elapsed second.\n\n```sh\ndocker exec servername cat /tmp/ELAPSED_TIME\n```\n\nshow package elapsed time label.\n\n```sh\ndocker exec servername cat /tmp/ELAPSED_TIME_LABEL\n```\n\nshow git commit hash that currently deployed successfully.\n```sh\ndocker exec servername cat /tmp/CURRENT_GIT_COMMIT_ID\n```\n\n___\n\n## Docker-Compose\n\n ```docker\nversion: '3'\nservices:\n  hookserver:\n    image: funnyzak/git-webhook\n    privileged: true\n    container_name: git-hook\n    working_dir: /app/code\n    logging:\n      driver: 'json-file'\n      options:\n        max-size: '1g'\n    tty: true\n    environment:\n      - TZ=Asia/Shanghai\n      - LANG=C.UTF-8\n      - USE_HOOK=1\n      - HOOK_TOKEN=hello\n      - GIT_REPO=https://github.com/vuejs/vuepress.git\n      - GIT_BRANCH=master\n      - GIT_EMAIL=youremail\n      - GIT_NAME=yourname\n      - STARTUP_COMMANDS=echo \"STARTUP_COMMANDS helllo\"\n      - AFTER_PULL_COMMANDS=echo \"AFTER_PULL_COMMANDS hello\"\n      - BEFORE_PULL_COMMANDS=echo \"AFTER_PULL_COMMANDS”\n      - APP_NAME=myapp\n      - NOTIFY_ACTION_LABEL=已启动|源码拉取中..|源码已拉取最新,开始打包..|部署已完成\n      - NOTIFY_ACTION_LIST=StartUp|BeforePull|AfterPull|AfterPackage\n      - TELEGRAM_BOT_TOKEN=123456789:SDFW33-CbovPM2TeHFCiPUDTLy1uYmN04I###9865678987\n      - DINGTALK_TOKEN_LIST=dingtoken_one|dingtoken_two\n      - JISHIDA_TOKEN_LIST=jishida_token\n    restart: on-failure\n    ports:\n      - 1001:9000\n    volumes:\n      - ./custom_scripts:/custom_scripts\n      - ./code:/app/code\n      - ./ssh:/root/.ssh\n\n ```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunnyzak%2Fgit-webhook-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffunnyzak%2Fgit-webhook-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffunnyzak%2Fgit-webhook-docker/lists"}