Add production build and deploy command
This commit is contained in:
parent
59eba56153
commit
49480c5d67
5 changed files with 19 additions and 6 deletions
4
frontend/.gitignore → .gitignore
vendored
4
frontend/.gitignore → .gitignore
vendored
|
@ -3,14 +3,14 @@
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
# compiled output
|
# compiled output
|
||||||
/dist
|
dist
|
||||||
/tmp
|
/tmp
|
||||||
/out-tsc
|
/out-tsc
|
||||||
# Only exists if Bazel was run
|
# Only exists if Bazel was run
|
||||||
/bazel-out
|
/bazel-out
|
||||||
|
|
||||||
# dependencies
|
# dependencies
|
||||||
/node_modules
|
node_modules
|
||||||
|
|
||||||
# profiling files
|
# profiling files
|
||||||
chrome-profiler-events*.json
|
chrome-profiler-events*.json
|
|
@ -6,7 +6,7 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./frontend:/home/node/app
|
- ./frontend:/home/node/app
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
- COMMAND=run
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -2,8 +2,10 @@ FROM node:16
|
||||||
|
|
||||||
EXPOSE 4200
|
EXPOSE 4200
|
||||||
|
|
||||||
COPY docker.sh /docker.sh
|
|
||||||
RUN chmod +x docker.sh
|
|
||||||
WORKDIR /home/node/app
|
WORKDIR /home/node/app
|
||||||
|
|
||||||
ENTRYPOINT /docker.sh
|
ENTRYPOINT [ "/docker.sh" ]
|
||||||
|
CMD [ "run" ]
|
||||||
|
|
||||||
|
COPY docker.sh /docker.sh
|
||||||
|
RUN chmod +x /docker.sh
|
||||||
|
|
|
@ -1,3 +1,13 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
if [ $COMMAND == "deploy" ]; then
|
||||||
|
npm run buildProd
|
||||||
|
npm install -g firebase-tools
|
||||||
|
firebase login --no-localhost
|
||||||
|
firebase deploy
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Installing packages"
|
echo "Installing packages"
|
||||||
npm install
|
npm install
|
||||||
echo "Running application"
|
echo "Running application"
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve --host 0.0.0.0 --disable-host-check",
|
"start": "ng serve --host 0.0.0.0 --disable-host-check",
|
||||||
"build": "ng build",
|
"build": "ng build",
|
||||||
|
"buildProd": "ng build --prod",
|
||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"lint": "ng lint",
|
"lint": "ng lint",
|
||||||
"e2e": "ng e2e"
|
"e2e": "ng e2e"
|
||||||
|
|
Loading…
Reference in a new issue