This repository was archived by the owner on Jul 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ # Use alpine latest as the base image
2+ FROM alpine:latest as builder
3+
4+ # Build variables
5+ ARG NITRO_VERSION=0.3.14
6+
7+ # Create build directory
8+ WORKDIR /work
9+
10+ # Install build dependencies
11+ RUN apk add --no-cache git cmake g++ make util-linux-dev zlib-dev
12+
13+ # Clone code
14+ RUN git clone --recurse-submodules -j2 --depth 1 --branch v${NITRO_VERSION} --single-branch https://github.com/janhq/nitro.git
15+
16+ # Build
17+ RUN cd nitro && \
18+ cmake -S nitro_deps/ -B ./build_deps/nitro_deps && \
19+ cmake --build ./build_deps/nitro_deps/ --config Release && \
20+ mkdir build && \
21+ cd build && \
22+ cmake .. && \
23+ make -j $(nproc) && \
24+ chmod +x ./nitro
25+
26+ # Create the final image
27+ FROM alpine:latest
28+
29+ # Install runtime dependencies from stripped down g++ and util-linux-dev (without dev packages)
30+ RUN apk add --no-cache libstdc++ gmp isl25 mpc1 mpfr4 zlib libuuid
31+
32+ # Create working directory
33+ WORKDIR /app
34+
35+ # Copy the binary from the builder image
36+ COPY --from=builder /work/nitro/build/nitro /app/nitro
37+
38+ # Expose port
39+ EXPOSE 3928
40+
41+ # Set the command to run nitro
42+ ENTRYPOINT [ "/app/nitro" ]
43+ CMD [ "1" , "0.0.0.0" , "3928" ]
You can’t perform that action at this time.
0 commit comments