Fix npm scripts to be able to run from project root (#717)

* fix npm scripts to be able to run from project root

* copy package.json from root for prod dockerfile

* fix k8s deployment manifest template
This commit is contained in:
Akshay 2021-09-09 17:15:59 +05:30 committed by GitHub
parent 761d2e412a
commit a625f7f9bf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View file

@ -23,7 +23,7 @@ spec:
- name: container
image: tooljet/tooljet-ce:latest
imagePullPolicy: Always
args: ["npm", 'start:prod']
args: ["npm", "run", "start:prod"]
resources:
limits:
memory: "2000Mi"

View file

@ -11,6 +11,7 @@ RUN apt update && apt install -y \
RUN mkdir -p /app
WORKDIR /app
ENV NODE_ENV=production
COPY ./package.json ./package-lock.json .
# Building ToolJet client
COPY ./frontend/package.json ./frontend/package-lock.json ./frontend/
@ -25,6 +26,4 @@ COPY ./server/ ./server/
RUN npm install -g @nestjs/cli
RUN npm --prefix server run build
COPY ./docker/ ./docker/
ENTRYPOINT ["./server/entrypoint.sh"]

View file

@ -24,6 +24,10 @@
"scripts": {
"build": "npm --prefix frontend install && NODE_ENV=production npm --prefix frontend run build && npm --prefix server install && NODE_ENV=production npm --prefix server run build",
"start:prod": "npm --prefix server run start:prod",
"db:create": "npm --prefix server run db:create",
"db:migrate": "npm --prefix server run db:migrate",
"db:reset": "npm --prefix server run db:reset",
"db:drop": "npm --prefix server run db:drop",
"deploy": "cp -a frontend/build/. public/",
"heroku-postbuild": "npm run build && npm run deploy",
"heroku-prebuild": "npm --prefix frontend install && npm --prefix server install ",