Skip to content

Conversation

wesleybl
Copy link
Member

The corepack use pnpm@9 command is unnecessary since corepack is already enabled and will automatically detect and use the appropriate pnpm version based on the project configuration. This change simplifies the Dockerfile and maintains consistency with other Docker images in the project.

I was going to upgrade to pnpm 10. But I saw that it wasn't necessary, and the only reference to pnpm 9 is there.

Ref: plone/volto#7239

The `corepack use pnpm@9` command is unnecessary since corepack is already
enabled and will automatically detect and use the appropriate pnpm version
based on the project configuration. This change simplifies the Dockerfile
and maintains consistency with other Docker images in the project.
@wesleybl
Copy link
Member Author

@sneridagh @davisagli @ericof can you take a look please?

@sneridagh
Copy link
Member

@wesleybl We had to do this because we had problems if it was not set (specially when 10 was released). If 11 is released, we will have the same pitfall.

Another issues is that I don't know if we can do it for 18, without it being breaking. For 19, could be that is ok.
@davisagli @ericof we will have to investigate it.

@github-project-automation github-project-automation bot moved this to Needs discussion in Volto Team Meeting Jul 12, 2025
@sneridagh sneridagh requested a review from ericof July 12, 2025 14:39
@wesleybl
Copy link
Member Author

@wesleybl We had to do this because we had problems if it was not set (specially when 10 was released). If 11 is released, we will have the same pitfall.

@sneridagh I don't understand why this line is necessary when pnpm 11 is released. What problem occurred when pnpm 10 was released?

This line serves more to tell the project which pnpm version it should use. But cookieplone already specifies which pnpm version to use in its package.json. So it doesn't make sense to run corepack use pnpm@9 here. Even so, it will install the latest version of 9, which is currently 9.15, but the current version specified in cookieplone is 9.1.1. So, when pnpm start:prod is run here:

# Entrypoint would be pnpm
ENTRYPOINT [ "pnpm" ]
# And the image will run in production mode
CMD ["start:prod"]

corepack would detect that version 9.15 is not the one required by package.json and would download version 9.1.1.

One advantage of already having the correct version installed would be that the container startup would take a few seconds less time to load, since the correct version would already be installed. But it would have to be the same version as cookieplone, not @9. Even so, I don't think it's worth having to keep the version here, just to start the container 2 seconds faster.

Another issues is that I don't know if we can do it for 18, without it being breaking.

I don't think the changes will be breaking. It will work with pnpm 9 as well, if the user wants to continue using 9.

@wesleybl
Copy link
Member Author

@ericof @davisagli Can you take a look here please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs discussion
Development

Successfully merging this pull request may close these issues.

2 participants