Dev/prod env support

This commit is contained in:
2023-04-26 17:25:58 +08:00
parent ee59990d85
commit 627774c910
6 changed files with 123 additions and 1 deletions
Executable
+15
View File
@@ -0,0 +1,15 @@
#!/usr/bin/env sh
set -e
set -x
export NODE_ENV="${NODE_ENV:-development}"
if [ $NODE_ENV == "development" ]; then
# this runs webpack-dev-server with hot reloading
npm start
else
# build the app and serve it via nginx
npm run build
nginx -g 'daemon off;' -c /usr/src/app/nginx.conf
nginx -c /usr/src/app/nginx.conf
fi