Repository navigation
perf: use slim Node base image, npm ci and tighter .dockerignore in JS/TS templates - #1184
Merged
Merged
Conversation
…JS/TS templates - Non-browser templates use apify/actor-node:24-slim. The template installs its own apify and crawlee, so the preinstalled copies only add size. The npm ls check of preinstalled packages is removed, it fails on slim. - Use npm ci when package-lock.json exists. Fall back to npm install without a lockfile, which is the state of a freshly created template. - Add a comment before COPY . ./ that copying only the needed files gives more build cache hits. - .dockerignore excludes .github, test and (for TS) dist. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016XtpQvUW4S4akcNA5XXGaQ
metalwarrior665
marked this pull request as ready for review
November 9, 2026 21:54
…e Docker builds Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_016XtpQvUW4S4akcNA5XXGaQ
Member
Author
|
I added a few more things we use to .dockerignore. In our testing library, we check dockerignore to see what can influence Actor code and we hope more community will adopt it. |
Contributor
after recent events, |
Member
Author
|
I wouldn't put whole .claude there, teams are sharing their skills etc. But the local settings make sense |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This applies Dockerfile practices from our store Actor repos to the JS and TS templates.
Changes:
apify/actor-node:24now useapify/actor-node:24-slim. Each template installs its ownapifyandcrawlee, so the preinstalled copies only make the image bigger. Thenpm lscheck of preinstalled packages is removed from these templates because it fails on slim. Browser templates keep their current base images.npm ciwhenpackage-lock.jsonexists. Without a lockfile, which is the state of a newly created template, it falls back tonpm install.COPY . ./says that copying only the files the Actor needs gives more build cache hits. The copy stays as it is, so user projects do not break on missing files..dockerignorenow also excludes:.githubin all templates.testin all templates exceptjs-cypressandts-playwright-test-runner, because there the tests are the Actor.distin the TS templates that did not exclude it..husky,lefthook.yml,.claude,AGENTS.md,CLAUDE.mdandvitest.config.tsin all templates. The templates shipAGENTS.mdandCLAUDE.md. Our store repos commonly add the other files.I did not build the images locally. The Docker build workflow in this PR's CI covers the fallback path, because the templates have no lockfile.
Possible existing issue, not changed here:
ts-playwright-test-runnerstarts withnode dist/main.js, but its Dockerfile has no build step anddistis in.gitignore.🤖 Generated with Claude Code
https://claude.ai/code/session_016XtpQvUW4S4akcNA5XXGaQ