entrypoint.sh in sequence. The exact steps depend on whether this is a first start, whether GIT_URL is set, and whether AUTO_UPDATE is enabled.
First start (empty container, GIT_URL set)
When the container has nopackage.json and GIT_URL is configured, the egg clones your repository from scratch before doing anything else.
Clone the repository
Because no If
package.json exists, the egg clears the container directory and clones your repository:GIT_BRANCH is empty, git uses the repository’s default branch. If USERNAME and ACCESS_TOKEN are set, the egg injects them into the URL automatically — you never need to embed credentials in GIT_URL yourself.Copy .env file (if present)
If This is how you inject environment variables without exposing them in panel variables. Upload
.env.pterodactyl exists in /home/container, the egg copies it to .env:.env.pterodactyl via the File Manager before starting.Detect or use the configured package manager
The egg reads the
If you set
PACKAGE_MANAGER variable (default: auto). In auto mode it inspects your project for a lockfile:| Lockfile found | Package manager used |
|---|---|
pnpm-lock.yaml | pnpm |
yarn.lock | yarn |
| neither | npm |
PACKAGE_MANAGER explicitly to npm, pnpm, or yarn, that value is used regardless of which lockfiles are present.If pnpm or yarn is not already installed in the container, the egg installs it globally via npm before continuing.Install dependencies
Dependencies are installed using the detected or configured package manager:
| Package manager | Command |
|---|---|
npm (with package-lock.json) | npm ci |
| npm (no lockfile) | npm install |
| pnpm | pnpm install --frozen-lockfile (falls back to pnpm install) |
| yarn | yarn install --frozen-lockfile (falls back to yarn install) |
Build the application (production only)
If
This step is skipped entirely when
NODE_RUN_ENV=production, the egg builds your app before starting it:| Package manager | Build command |
|---|---|
| npm | npm run build |
| pnpm | pnpm run build |
| yarn | yarn build |
NODE_RUN_ENV=development.Start Cloudflare Tunnel (if configured)
If If
CLOUDFLARE_TOKEN is set, the egg downloads cloudflared (if not already present) and starts the tunnel in the background before launching Next.js:CLOUDFLARE_TOKEN is empty, this step is skipped.The egg runs
npm run build (or the equivalent pnpm/yarn command) on every start in production mode. This ensures your app always reflects the latest code.Subsequent starts with AUTO_UPDATE=1
WhenAUTO_UPDATE=1 and a .git directory is present, the egg pulls the latest commits before reinstalling and rebuilding.
Pull latest changes
The egg resets any local changes and pulls from the remote:If
GIT_BRANCH is empty, the egg runs git pull against the current tracking branch.Install dependencies
Same install commands as on first start. Running this on every restart ensures any newly added packages from the latest commit are present.
Build the application (production only)
Same build step as on first start —
next build runs every time in production mode.Start Cloudflare Tunnel (if configured)
Same as first start — starts
cloudflared in the background if CLOUDFLARE_TOKEN is set.Subsequent starts with AUTO_UPDATE=0
WhenAUTO_UPDATE=0, the egg skips all git operations and uses whatever code is already in the container.
Skip git pull
The egg detects that
AUTO_UPDATE is not 1 and logs AUTO_UPDATE disabled — skipping pull. No git commands are run. The code currently on disk is used as-is.Copy .env file (if present)
If
.env.pterodactyl exists, it is still copied to .env on every start regardless of the AUTO_UPDATE setting.Install dependencies
Dependencies are still installed on every restart to account for any manual changes to
package.json.Build the application (production only)
The build still runs on every restart in production mode, even without a git pull.
Start Cloudflare Tunnel (if configured)
Same as first start — starts
cloudflared in the background if CLOUDFLARE_TOKEN is set.GIT_URL is empty
If you leaveGIT_URL blank, the egg skips all git operations entirely and expects you to have uploaded your project files manually.
- All git steps (clone, fetch, pull) are skipped.
- The egg checks whether
/home/container/package.jsonexists. If it does not, the egg exits immediately with an error:You must upload your project files — includingpackage.json— via the panel’s File Manager before restarting. - If
package.jsonis found, the egg continues with the.envcopy, dependency install, build (if production), and Next.js start steps as normal.