-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,41 @@ | ||
## npmrun | ||
A low-memory replacement for "npm run" written in Rust for Docker containers. | ||
A low-memory replacement for "npm run" written in Rust for Docker containers. | ||
|
||
### Usage | ||
```Dockerfile | ||
FROM rust:1-alpine as npmrun-builder | ||
WORKDIR /src | ||
|
||
RUN apk add --no-cache git alpine-sdk | ||
|
||
RUN git clone https://github.com/nexryai/npmrun.git . | ||
RUN cargo build --release | ||
|
||
FROM node:20-alpine3.19 AS builder | ||
|
||
ARG NODE_ENV=production | ||
|
||
######## | ||
# <Command to build your app> | ||
######## | ||
|
||
FROM node:20-alpine3.19 AS runner | ||
|
||
######## | ||
# <Copy files from builder> | ||
######## | ||
|
||
COPY --from=npmrun-builder /src/target/release/npmrun /usr/local/bin/npmrun | ||
|
||
ENV NODE_ENV=production | ||
ENTRYPOINT ["/sbin/tini", "--"] | ||
CMD ["npmrun", "docker:start"] | ||
``` | ||
|
||
### Effects | ||
|
||
#### Before | ||
![Before](https://raw.githubusercontent.com/nexryai/npmrun/main/docs/before.png) | ||
|
||
#### After | ||
![After](https://raw.githubusercontent.com/nexryai/npmrun/main/docs/after.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.