Add production build and deploy command

This commit is contained in:
Norbi Peti 2021-11-09 01:55:57 +01:00
parent 59eba56153
commit 49480c5d67
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56
5 changed files with 19 additions and 6 deletions

View file

@ -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

View file

@ -6,7 +6,7 @@ services:
volumes:
- ./frontend:/home/node/app
environment:
- NODE_ENV=development
- COMMAND=run
networks:
default:

View file

@ -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

View file

@ -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"

View file

@ -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"