Skip to content

Commit 69b0213

Browse files
committed
Improve deployment time
1 parent bfb22b6 commit 69b0213

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

pill_mate/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ RUN apk add --no-cache nginx nodejs npm
77

88
COPY . /app/
99

10-
RUN cd backend && npm install && npm run build
11-
12-
RUN cd frontend && npm install && npm run build
10+
RUN bash build.sh
1311

1412
CMD [ "./run.sh" ]

pill_mate/build.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/bash
2+
3+
set -e
4+
5+
source .env
6+
7+
build_backend() {
8+
pushd backend
9+
npm install
10+
npm run build
11+
popd
12+
}
13+
14+
build_frontend() {
15+
if [ $DEV -eq 0 ]; then
16+
pushd frontend
17+
npm install
18+
npm run build
19+
popd
20+
fi
21+
}
22+
23+
build_backend &
24+
build_frontend &
25+
wait

0 commit comments

Comments
 (0)