Dockerfile: use number of make jobs based on nproc
This commit is contained in:
parent
e87367d22f
commit
c71d634e82
@ -6,7 +6,7 @@ WORKDIR /go/src/commento-ce/api
|
|||||||
|
|
||||||
RUN apk update && apk add bash make git
|
RUN apk update && apk add bash make git
|
||||||
|
|
||||||
RUN make prod -j8
|
RUN make prod -j$(($(nproc) + 1))
|
||||||
|
|
||||||
|
|
||||||
# frontend build (html, js, css, images)
|
# frontend build (html, js, css, images)
|
||||||
@ -18,7 +18,7 @@ WORKDIR /commento-ce/frontend/
|
|||||||
RUN apk update && apk add bash make
|
RUN apk update && apk add bash make
|
||||||
RUN npm install -g html-minifier@3.5.7 uglify-js@3.4.1 sass@1.5.1
|
RUN npm install -g html-minifier@3.5.7 uglify-js@3.4.1 sass@1.5.1
|
||||||
|
|
||||||
RUN make prod -j8
|
RUN make prod -j$(($(nproc) + 1))
|
||||||
|
|
||||||
|
|
||||||
# templates build
|
# templates build
|
||||||
@ -29,7 +29,7 @@ WORKDIR /commento-ce/templates
|
|||||||
|
|
||||||
RUN apk update && apk add bash make
|
RUN apk update && apk add bash make
|
||||||
|
|
||||||
RUN make prod -j8
|
RUN make prod -j$(($(nproc) + 1))
|
||||||
|
|
||||||
|
|
||||||
# db build
|
# db build
|
||||||
@ -40,7 +40,7 @@ WORKDIR /commento-ce/db
|
|||||||
|
|
||||||
RUN apk update && apk add bash make
|
RUN apk update && apk add bash make
|
||||||
|
|
||||||
RUN make prod -j8
|
RUN make prod -j$(($(nproc) + 1))
|
||||||
|
|
||||||
|
|
||||||
# final image
|
# final image
|
||||||
|
@ -10,7 +10,7 @@ ctrl_c() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binary_pid=
|
binary_pid=
|
||||||
if make -j8; then
|
if make -j$(($(nproc) + 1)); then
|
||||||
source devel.env
|
source devel.env
|
||||||
cd build/devel
|
cd build/devel
|
||||||
./$binary_name &
|
./$binary_name &
|
||||||
@ -50,7 +50,7 @@ while true; do
|
|||||||
wait $binary_pid
|
wait $binary_pid
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if make -j8; then
|
if make -j$(($(nproc) + 1)); then
|
||||||
source devel.env
|
source devel.env
|
||||||
cd build/devel
|
cd build/devel
|
||||||
./$binary_name &
|
./$binary_name &
|
||||||
|
Loading…
Reference in New Issue
Block a user