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
|
||||
|
||||
# compiled output
|
||||
/dist
|
||||
dist
|
||||
/tmp
|
||||
/out-tsc
|
||||
# Only exists if Bazel was run
|
||||
/bazel-out
|
||||
|
||||
# dependencies
|
||||
/node_modules
|
||||
node_modules
|
||||
|
||||
# profiling files
|
||||
chrome-profiler-events*.json
|
|
@ -6,7 +6,7 @@ services:
|
|||
volumes:
|
||||
- ./frontend:/home/node/app
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
- COMMAND=run
|
||||
|
||||
networks:
|
||||
default:
|
||||
|
|
|
@ -2,8 +2,10 @@ FROM node:16
|
|||
|
||||
EXPOSE 4200
|
||||
|
||||
COPY docker.sh /docker.sh
|
||||
RUN chmod +x docker.sh
|
||||
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"
|
||||
npm install
|
||||
echo "Running application"
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"ng": "ng",
|
||||
"start": "ng serve --host 0.0.0.0 --disable-host-check",
|
||||
"build": "ng build",
|
||||
"buildProd": "ng build --prod",
|
||||
"test": "ng test",
|
||||
"lint": "ng lint",
|
||||
"e2e": "ng e2e"
|
||||
|
|
Loading…
Reference in a new issue