Skip to content

Commit

Permalink
fix: update docker container configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
jzhangdev committed Apr 7, 2024
1 parent 2c563ec commit d5efb09
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,23 @@ To install this plugin in your own Verdaccio docker image:
Create a Dockerfile:

```dockerfile
FROM node:lts-alpine as builder

RUN mkdir -p /verdaccio/plugins \
&& cd /verdaccio/plugins \
&& npm install --global-style --no-bin-links --omit=optional @rightcapital/verdaccio-package-diff

FROM verdaccio/verdaccio:5

COPY --from=builder --chown=$VERDACCIO_USER_UID:root \
/verdaccio/plugins/node_modules/@rightcapital/verdaccio-package-diff \
/verdaccio/plugins/@rightcapital/verdaccio-package-diff

USER root
RUN npm install --global @rightcapital/verdaccio-package-diff
RUN chown -R 10001:65533 "/opt/verdaccio/.npm"

RUN mkdir -p /opt/verdaccio/.npm
RUN chown -R $VERDACCIO_USER_UID:root /opt/verdaccio/.npm

USER $VERDACCIO_USER_UID
```

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "fix: update docker container configuration",
"packageName": "@rightcapital/verdaccio-package-diff",
"email": "[email protected]",
"dependentChangeType": "none"
}
17 changes: 15 additions & 2 deletions example/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
FROM node:lts-alpine as builder

RUN mkdir -p /verdaccio/plugins \
&& cd /verdaccio/plugins \
&& npm install --global-style --no-bin-links --omit=optional @rightcapital/verdaccio-package-diff

FROM verdaccio/verdaccio:5

COPY --from=builder --chown=$VERDACCIO_USER_UID:root \
/verdaccio/plugins/node_modules/@rightcapital/verdaccio-package-diff \
/verdaccio/plugins/@rightcapital/verdaccio-package-diff

USER root
RUN npm install --global @rightcapital/verdaccio-package-diff
RUN chown -R 10001:65533 "/opt/verdaccio/.npm"

RUN mkdir -p /opt/verdaccio/.npm
RUN chown -R $VERDACCIO_USER_UID:root /opt/verdaccio/.npm

USER $VERDACCIO_USER_UID

0 comments on commit d5efb09

Please sign in to comment.