mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Run babel node instead of nodemon
Quote of @appinteractive: ``` Currently we are running nodemon on production which watches for filechanges and consumes much more memory then just node. As nodemon is only for development, I added a build step to compile the application for production and then only run the dist folder with pure node. ```
This commit is contained in:
parent
212725e44d
commit
9f78a96de2
13
.babelrc
13
.babelrc
@ -1 +1,12 @@
|
||||
{ "presets": ["@babel/preset-env"] }
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"node": "10"
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
|
||||
@ -22,7 +22,9 @@ install:
|
||||
- docker-compose -f docker-compose.yml up -d
|
||||
|
||||
script:
|
||||
- docker-compose exec backend yarn run ci
|
||||
- docker-compose exec backend yarn run lint
|
||||
- docker-compose exec backend yarn run test
|
||||
- docker-compose exec backend yarn run test:coverage
|
||||
- docker-compose exec backend yarn run db:reset
|
||||
- docker-compose exec backend yarn run db:seed
|
||||
|
||||
|
||||
@ -16,4 +16,5 @@ RUN yarn install --production=false --frozen-lockfile --non-interactive
|
||||
COPY . .
|
||||
COPY .env.template .env
|
||||
|
||||
RUN yarn run build
|
||||
CMD ["yarn", "run", "start"]
|
||||
|
||||
@ -63,6 +63,14 @@ Configure the file `.env` according to your needs and your local setup.
|
||||
|
||||
Start the GraphQL service:
|
||||
|
||||
```bash
|
||||
yarn dev
|
||||
# -or-
|
||||
npm dev
|
||||
```
|
||||
|
||||
And on the production machine run following:
|
||||
|
||||
```bash
|
||||
yarn start
|
||||
# -or-
|
||||
|
||||
0
dist/.gitkeep
vendored
Normal file
0
dist/.gitkeep
vendored
Normal file
30
package.json
30
package.json
@ -7,25 +7,22 @@
|
||||
"no_auth": "cross-env GRAPHQL_URI=http://localhost:4001 GRAPHQL_PORT=4001 PERMISSIONS=disabled"
|
||||
},
|
||||
"scripts": {
|
||||
"ci": "yarn run lint && yarn run test && yarn run test:coverage",
|
||||
"build": "babel src/ -d dist/ --copy-files",
|
||||
"start": "node dist/",
|
||||
"dev": "nodemon --exec babel-node src/index.js",
|
||||
"dev:debug": "nodemon --exec babel-node --inspect=0.0.0.0:9229 src/index.js",
|
||||
"mocha": "mocha --require @babel/register src/**/*.test.js",
|
||||
"lint": "eslint src --config .eslintrc.js",
|
||||
"test": "./node_modules/.bin/nyc --reporter=text-lcov ./node_modules/.bin/mocha --require @babel/register src/**/*.test.js",
|
||||
"test:coverage": "./node_modules/.bin/nyc report --reporter=text-lcov > coverage.lcov",
|
||||
"start": "./node_modules/.bin/nodemon --exec babel-node src/index.js",
|
||||
"start:debug": "./node_modules/.bin/nodemon --exec babel-node --inspect=0.0.0.0:9229 src/index.js",
|
||||
"db:script:seed": "wait-on tcp:4001 && ./node_modules/.bin/babel-node src/seed/seed-db.js",
|
||||
"db:script:reset": "wait-on tcp:4001 && ./node_modules/.bin/babel-node src/seed/reset-db.js",
|
||||
"test": "nyc --reporter=text-lcov mocha --require @babel/register src/**/*.test.js",
|
||||
"test:coverage": "nyc report --reporter=text-lcov > coverage.lcov",
|
||||
"db:script:seed": "wait-on tcp:4001 && babel-node src/seed/seed-db.js",
|
||||
"db:script:reset": "wait-on tcp:4001 && babel-node src/seed/reset-db.js",
|
||||
"db:seed": "$npm_package_config_no_auth run-p --race start db:script:seed",
|
||||
"db:reset": "$npm_package_config_no_auth run-p --race start db:script:reset"
|
||||
},
|
||||
"author": "Human Connection gGmbH",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@babel/cli": "~7.2.0",
|
||||
"@babel/core": "~7.2.0",
|
||||
"@babel/node": "~7.2.0",
|
||||
"@babel/preset-env": "~7.2.0",
|
||||
"@babel/register": "~7.0.0",
|
||||
"apollo-cache-inmemory": "~1.3.11",
|
||||
"apollo-client": "~2.4.7",
|
||||
"apollo-link-http": "~1.5.7",
|
||||
@ -52,10 +49,16 @@
|
||||
"passport": "~0.4.0",
|
||||
"passport-jwt": "~4.0.0",
|
||||
"sanitize-html": "~1.19.3",
|
||||
"faker": "~4.1.0",
|
||||
"slug": "~0.9.3",
|
||||
"trunc-html": "~1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "~7.2.0",
|
||||
"@babel/core": "~7.2.0",
|
||||
"@babel/node": "~7.2.0",
|
||||
"@babel/preset-env": "~7.2.0",
|
||||
"@babel/register": "~7.0.0",
|
||||
"apollo-server-testing": "~2.2.6",
|
||||
"babel-eslint": "~10.0.1",
|
||||
"chai": "~4.2.0",
|
||||
@ -65,8 +68,7 @@
|
||||
"eslint-plugin-node": "~8.0.0",
|
||||
"eslint-plugin-promise": "~4.0.1",
|
||||
"eslint-plugin-standard": "~4.0.0",
|
||||
"faker": "~4.1.0",
|
||||
"mocha": "^5.2.0",
|
||||
"mocha": "~5.2.0",
|
||||
"nodemon": "~1.18.8",
|
||||
"npm-run-all": "~4.1.5",
|
||||
"nyc": "^13.1.0",
|
||||
|
||||
@ -4163,7 +4163,7 @@ mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1:
|
||||
dependencies:
|
||||
minimist "0.0.8"
|
||||
|
||||
mocha@^5.2.0:
|
||||
mocha@~5.2.0:
|
||||
version "5.2.0"
|
||||
resolved "https://registry.yarnpkg.com/mocha/-/mocha-5.2.0.tgz#6d8ae508f59167f940f2b5b3c4a612ae50c90ae6"
|
||||
integrity sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user