Skip to content
This repository was archived by the owner on Feb 3, 2019. It is now read-only.

Commit 0b250b5

Browse files
author
Deissh
committed
Merge branch 'feature/run'
2 parents 96eaa73 + 0049ea0 commit 0b250b5

32 files changed

+3366
-2202
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
docker-compose.env
2+
docker-compose.yml
3+
Dockerfile
4+
node_modules
5+
test
6+
.vscode

.editorconfig

Lines changed: 0 additions & 10 deletions
This file was deleted.

.eslintrc

Lines changed: 0 additions & 97 deletions
This file was deleted.

.eslintrc.js

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
module.exports = {
2+
"root": true,
3+
"env": {
4+
"node": true,
5+
"commonjs": true,
6+
"es6": true,
7+
"jquery": false,
8+
"jest": true,
9+
"jasmine": true
10+
},
11+
"extends": "eslint:recommended",
12+
"parserOptions": {
13+
"sourceType": "module"
14+
},
15+
"rules": {
16+
"quotes": [
17+
"warn",
18+
"double"
19+
],
20+
"semi": [
21+
"error",
22+
"always"
23+
],
24+
"no-var": [
25+
"error"
26+
],
27+
"no-console": [
28+
"off"
29+
],
30+
"no-unused-vars": [
31+
"warn"
32+
],
33+
"no-mixed-spaces-and-tabs": [
34+
"warn"
35+
]
36+
}
37+
};

.gitattributes

Lines changed: 0 additions & 2 deletions
This file was deleted.

.gitignore

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,61 @@
1-
.DS_Store
1+
# Logs
2+
logs
23
*.log
3-
*.pem
4-
*.rsa
5-
node_modules
6-
config/config.json
7-
*/public
8-
temp
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (https://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# Typescript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# Yarn Integrity file
55+
.yarn-integrity
56+
57+
# dotenv environment variables file
58+
.env
59+
60+
# next.js build output
61+
.next

.vscode/launch.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
// Use IntelliSense to learn about possible Node.js debug attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
8+
{
9+
"type": "node",
10+
"request": "launch",
11+
"name": "Debug",
12+
"program": "${workspaceRoot}/node_modules/moleculer/bin/moleculer-runner.js",
13+
"cwd": "${workspaceRoot}",
14+
"args": [
15+
"services"
16+
]
17+
},
18+
{
19+
"type": "node",
20+
"request": "launch",
21+
"name": "Jest",
22+
"program": "${workspaceRoot}/node_modules/jest-cli/bin/jest.js",
23+
"args": ["--runInBand"],
24+
"cwd": "${workspaceRoot}",
25+
"runtimeArgs": [
26+
"--nolazy"
27+
]
28+
}
29+
]
30+
}

Dockerfile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
FROM node:10-alpine
2-
ENV NODE_ENV production
3-
MAINTAINER FunctionRunner deissh@yandex.ru
1+
FROM node:8-alpine
2+
3+
ENV NODE_ENV=production
4+
5+
RUN mkdir /app
6+
WORKDIR /app
7+
8+
COPY package.json .
49

5-
WORKDIR /usr/src/app
6-
ADD package.json package.json
7-
# RUN npm install pino-elasticsearch -g
810
RUN npm install --production
9-
ADD . .
10-
CMD ["npm", "start"]
11+
12+
COPY . .
13+
14+
CMD ["npm", "start"]

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Simple Lambda Service
22

3+
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c4d781bc8ecd430b95385f8a4bc0fec5)](https://www.codacy.com/app/Deissh/lambda?utm_source=github.com&utm_medium=referral&utm_content=deissh/lambda&utm_campaign=Badge_Grade)
4+
[![David](https://img.shields.io/david/deissh/lambda.svg)](https://david-dm.org/deissh/lambda)
5+
[![Known Vulnerabilities](https://snyk.io/test/github/deissh/lambda/badge.svg)](https://snyk.io/test/github/deissh/lambda)
6+
7+
[![GitHub issues](https://img.shields.io/github/issues/deissh/lambda.svg)](https://github.com/deissh/lambda/issues)
8+
[![GitHub stars](https://img.shields.io/github/stars/deissh/lambda.svg)](https://github.com/deissh/lambda/stargazers)
9+
[![Twitter](https://img.shields.io/twitter/url/https/github.com/deissh/lambda.svg?style=social)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fdeissh%2Flambda)
10+
311
![img](https://blog.alexellis.io/content/images/2017/08/clip-1.png)
412

513
[RU](https://github.com/deissh/lambda/blob/master/README_RU.md)
@@ -10,6 +18,26 @@ Lambda is a framework for building Serverless functions with Docker which has fi
1018

1119
### Deployment
1220

21+
``` bash
22+
# Install dependencies
23+
npm install
24+
25+
# Start developing with REPL
26+
npm run dev
27+
28+
# Start production
29+
npm start
30+
31+
# Run unit tests
32+
npm test
33+
34+
# Run continuous test mode
35+
npm run ci
36+
37+
# Run ESLint
38+
npm run lint
39+
```
40+
1341
#### Docker with Docker Compose
1442

1543
If you won't use Node.JS and NVM in your workstation need to install Docker and also Docker-Compose. Then you have done you can configure `docker-composer.yml` and run it.

config/sample-config.json

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)