• Shell 89.1%
  • Dockerfile 10.9%
Find a file
2026-04-04 07:55:52 -05:00
scripts fix pnpm 2026-04-04 07:55:52 -05:00
.gitlab-ci.yml Initial commit 2025-10-01 10:09:20 -04:00
Dockerfile update some versions, fix depends not installing when new and not 2026-04-04 12:28:30 -05:00
Dockerfile.bun update some versions, fix depends not installing when new and not 2026-04-04 12:28:30 -05:00
Dockerfile.npm update some versions, fix depends not installing when new and not 2026-04-04 12:28:30 -05:00
Dockerfile.pnpm update some versions, fix depends not installing when new and not 2026-04-04 12:28:30 -05:00
Dockerfile.yarn update some versions, fix depends not installing when new and not 2026-04-04 12:28:30 -05:00
entrypoint.sh add support for extra packages 2025-10-01 10:43:14 -04:00
README.md GIT_WATCH 2025-10-11 15:12:51 -04:00

Docker Runner

A Docker-based CI/CD runner for Node.js projects that automatically clones repositories and executes package manager commands.

Features

  • Automatic git repository cloning and updating
  • Support for multiple package managers: npm, yarn, pnpm, bun
  • Persistent source directory with volume mounting
  • Automatic dependency installation
  • Shallow git clones for faster operations

Environment Variables

Required

  • COMMAND - Commands to execute (use && to chain multiple commands)
  • GIT_REPO - Git repository URL (e.g., https://github.com/user/repo.git)

Optional

  • PACKAGE_MANAGER - Package manager to use (default: npm)
    • Supported: npm, yarn, pnpm, bun
  • GIT_BRANCH - Git branch to checkout (default: main)
  • GIT_USERNAME - Git username for private repositories
  • GIT_ACCESS_TOKEN - Git access token for private repositories
  • GIT_DEPTH - Git clone depth (default: 1, use full for complete history)
  • GIT_SKIP_UPDATE - Skip git pull on existing repo (default: false, set to true to skip)
  • GIT_WATCH - Enable watch mode to auto-restart on git push (default: disabled)
    • Set to true or any non-empty value to enable (default interval: 60 seconds)
    • Set to a number to specify custom check interval in seconds (e.g., 30, 120)
    • Set to false or leave empty to disable
  • WORK_DIR - Working directory inside container (default: /source)
  • EXTRA_PACKAGES - Additional apt packages to install (e.g., sqlite3 python3-pip)

Package Managers

All package managers automatically run install if node_modules doesn't exist:

  • npm - npm install && npm run
  • yarn - yarn install && yarn run
  • pnpm - pnpm install && pnpm run
  • bun - bun install && bun

How It Works

  1. Container starts and navigates to WORK_DIR
  2. clone-repo.sh clones or updates the repository
  3. run-command.sh installs dependencies if needed
  4. Commands are executed in sequence
  5. If GIT_WATCH is enabled, monitors for changes and restarts on git push

Notes

  • Source directory is persisted via volume mount
  • Subsequent runs update the repository instead of re-cloning
  • Untracked files (like .env) are preserved between runs
  • Shallow clones (depth 1) are used by default for speed
  • Use specific Dockerfiles to reduce image size