Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
nexryai committed Jul 12, 2024
1 parent 6c262ad commit 0c34e20
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion README.md
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)
Binary file added 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.
Binary file added docs/before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 0c34e20

Please sign in to comment.