Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: docker image refactor #3475

Merged
merged 1 commit into from Nov 8, 2022
Merged

feat: docker image refactor #3475

merged 1 commit into from Nov 8, 2022

Conversation

juanpicado
Copy link
Member

@juanpicado juanpicado commented Nov 5, 2022

The docker image for verdaccio 5 uses internally yarn pnp wrapper in order to run the execution, I think this a step could be removed but just installing the verdaccio package directly in the docker image context. This PR removes yarn pnp and the project from the docker image entirely, yarn just used for building and pack the project in a tarball in a multi stage step, this reduces considerably the size (~50MB) (it's around 199MB due Node 18 also increases size #3469 nodejs/docker-node#1776, also improve the package npm size so is only packed what's need it.

Also improve the way the plugins are installed, relying only in npm global installation (yarn modern does not have global installation and this was making hard installing plugins.

The verdaccio image for v6 (that uses pnpm) would looks like exactly this one, thus the migration step won't be need it

For testing this improvement uses:

docker run -it --rm --name verdaccio -p 4873:4873 verdaccio/verdaccio:jota-docker-improved

Here an example how to install plugins by creating a new Dockerfile

FROM verdaccio/verdaccio:5
ADD custom-config.yaml /verdaccio/conf/config.yaml  
USER root
RUN npm install --global verdaccio-static-token \
  && npm install --global verdaccio-auth-memory
USER $VERDACCIO_USER_UID

Ref

Follow up of

@juanpicado juanpicado added this to the 5.x milestone Nov 5, 2022
@juanpicado juanpicado requested review from a team November 5, 2022 20:16
Dockerfile Show resolved Hide resolved
@juanpicado juanpicado marked this pull request as ready for review November 6, 2022 07:42
@juanpicado juanpicado merged commit ebaaf3f into 5.x Nov 8, 2022
@delete-merged-branch delete-merged-branch bot deleted the jota/docker-improved branch November 8, 2022 06:29
alerambo added a commit to alerambo/verdaccio-ldap that referenced this pull request Feb 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant