Added better prod script

This commit is contained in:
DrMint 2024-04-14 14:49:11 +02:00
parent 89f79cb7d5
commit 87a2ca1bc3
2 changed files with 2 additions and 5 deletions

View File

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

View File

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