• Shell 89%
  • Dockerfile 11%
Find a file
creations 717f5223b8
All checks were successful
ci / docker-build (push) Successful in 1m7s
fix pnpm
2026-06-14 20:03:57 -04:00
.forgejo/workflows forgejo workflow 2026-06-14 19:35:25 -04:00
scripts Merge remote-tracking branch 'refs/remotes/origin/main' 2026-06-14 19:39:04 -04:00
Dockerfile fix pnpm 2026-06-14 20:03:57 -04: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 fix pnpm 2026-06-14 20:03:57 -04:00
Dockerfile.yarn update some versions, fix depends not installing when new and not 2026-04-04 12:28:30 -05:00
entrypoint.sh fix some small issues 2026-06-14 19:28:01 -04:00
README.md Update README.md 2026-06-14 19:55:54 -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