https://github.com/softonic/docker-node-prune
Docker image for remove unnecessary files from node_modules (.md, .ts, ...)
https://github.com/softonic/docker-node-prune
docker-image node-prune
Last synced: about 2 months ago
JSON representation
Docker image for remove unnecessary files from node_modules (.md, .ts, ...)
- Host: GitHub
- URL: https://github.com/softonic/docker-node-prune
- Owner: softonic
- License: other
- Created: 2020-05-25T11:10:49.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2020-05-25T12:11:23.000Z (about 5 years ago)
- Last Synced: 2025-02-14T04:51:18.921Z (4 months ago)
- Topics: docker-image, node-prune
- Language: Shell
- Homepage: https://hub.docker.com/r/softonic/node-prune
- Size: 2.93 KB
- Stars: 3
- Watchers: 7
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node Prune
This creates an image with the node-prune binary on it.
The source code is obtained from the repository: https://github.com/tj/node-prune# Usage
You can clean your `node_modules` directory with the next command:
```shell script
docker run --rm --name node-prune \
-v $PWD:/app \
--workdir=/app \
softonic/node-prune:latest \
-verbose /app/node_modules
```
Or you can use it in a stage of your `Dockerfile`'s with an specific stage like:```dockerfile
...
FROM softonic/node-prune:latest AS prunerCOPY --from=builder /usr/src/app/node_modules /usr/src/app/node_modules
RUN node-prune /usr/src/app/node_modules
FROM builder AS production
COPY --from=pruner /usr/src/app/node_modules /usr/src/app/node_modules
...
```# Build
The source code is automatically built by Docker Hub, but if you want to build it locally just execute:
```shell script
VERSION=latest docker build -t softonic/node-prune:$VERSION .
```