-
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.
The Docker cluster was not working; not sure when that happened. Made improvements and fixes to the build and serve scripts. It's been a while since there's been a `build` dir, so I guess this has been broken for a while.
- Loading branch information
1 parent
3a0f029
commit 2cc2717
Showing
7 changed files
with
55 additions
and
40 deletions.
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,8 +1,7 @@ | ||
FROM node:gallium-alpine | ||
WORKDIR /opt/webapptemplate | ||
ENV NODE_ENV=production | ||
COPY build/ . | ||
RUN npm i | ||
COPY dist/ serve.sh . | ||
RUN npm ci | ||
EXPOSE 3000 | ||
CMD ["npm", "start"] | ||
|
||
CMD ["sh", "serve.sh"] |
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
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
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,4 +1,4 @@ | ||
FROM nginx | ||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY cert.pem /etc/nginx/cert.pem | ||
COPY key.pem /etc/nginx/key.pem | ||
# COPY cert.pem /etc/nginx/cert.pem | ||
# COPY key.pem /etc/nginx/key.pem |
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
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
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,21 +1,34 @@ | ||
#!/bin/bash | ||
# auto-reloading development server | ||
# setting SPAMODE will run in SPA mode | ||
# setting NODE_ENV=production will run without dev tooling | ||
|
||
set -e | ||
set -a | ||
. .env | ||
set +a | ||
APPPORT=3000 | ||
|
||
./node_modules/.bin/browser-sync start --port 9000 --proxy localhost:$APPPORT --no-open -f dist/client & | ||
BSPID=$! | ||
echo BrowserSync PID $BSPID | ||
trap "kill $BSPID 2> /dev/null" INT HUP TERM QUIT ABRT EXIT | ||
if [[ -z "$1" || "$1" -ne spa ]]; then | ||
(fswatch -ol 1 app | xargs -n1 -I{} ./build.sh) & | ||
npm run nodemon | ||
if [ "$NODE_ENV" = "production" ]; then | ||
echo "NODE_ENV is set to production" | ||
if [ -n "$SPAMODE" ]; then | ||
npx http-server -c-1 client/ -p $APPPORT | ||
else | ||
npx nodemon server/index.js | ||
fi | ||
else | ||
echo Server in SPA mode | ||
(fswatch -ol 1 app/client | xargs -n1 -I{} ./build.sh spa) & | ||
npx http-server dist/client/ -p $APPPORT | ||
./node_modules/.bin/browser-sync start --port 9000 --proxy localhost:$APPPORT --no-open -f dist/client & | ||
BSPID=$! | ||
echo BrowserSync PID $BSPID | ||
trap "kill -0 $BSPID &> /dev/null && kill $BSPID && echo sending SIGTERM to $BSPID" INT HUP TERM QUIT ABRT EXIT | ||
# if [[ -z "$1" || "$1" -ne spa ]]; then | ||
if [ -n "$SPAMODE" ]; then | ||
echo Server in SPA mode | ||
(fswatch -ol 1 app/client | xargs -n1 -I{} ./build.sh spa) & | ||
npx http-server -c-1 dist/client/ -p $APPPORT | ||
else | ||
(fswatch -ol 1 app | xargs -n1 -I{} ./build.sh) & | ||
npm run nodemon | ||
fi | ||
fi | ||
|