From 87a2ca1bc3c425818d5a8fe8562088fe93f96dcd Mon Sep 17 00:00:00 2001 From: DrMint <29893320+DrMint@users.noreply.github.com> Date: Sun, 14 Apr 2024 14:49:11 +0200 Subject: [PATCH] Added better prod script --- docker-compose.yml | 3 +-- package.json | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b3e41f2..9489c7c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,8 +9,7 @@ services: - .:/home/node/app - node_modules:/home/node/app/node_modules working_dir: /home/node/app/ - # command: sh -c "npm install && npm run generate:types && npm run dev" - command: sh -c "npm install && npm run generate:types && npm run build && npm run serve" + command: sh -c "npm run prod" depends_on: - mongo environment: diff --git a/package.json b/package.json index 7bc31db..56687e0 100644 --- a/package.json +++ b/package.json @@ -12,14 +12,12 @@ "serve": "cross-env PAYLOAD_CONFIG_PATH=dist/payload.config.js NODE_ENV=production node dist/server.js", "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png}\" dist/ && copyfiles -u 1 \"src/sdk.ts\" dist/ && copyfiles -u 1 \"src/constants.ts\" dist/ && copyfiles -u 1 \"src/types/collections.ts\" dist/", "generate:types": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:types", - "generate:graphQLSchema": "cross-env PAYLOAD_CONFIG_PATH=src/payload.config.ts payload generate:graphQLSchema", "unused-exports": "ts-unused-exports ./tsconfig.json --excludePathsFromReport='src/payload.config.ts;src/constants.ts;src/sdk.ts;src/types/collections.ts'", "prettier": "prettier --list-different --end-of-line auto --write src", "tsc": "tsc --noEmit", "precommit": "npm run generate:types && npm run prettier && npm run unused-exports && npm run tsc", "upgrade": "ncu", - "clean": "sudo rm -r uploads mongo", - "start": "npm install && npm run generate:types && npm run dev" + "prod": "rm -rf build && rm -rf dist && npm ci && npm run precommit && npm run build && npm run serve" }, "dependencies": { "@fontsource/vollkorn": "5.0.19",