This commit is contained in:
nezu 2021-12-25 20:53:13 +01:00
commit a5f0592577
9 changed files with 1705 additions and 0 deletions

6
.dockerignore Normal file
View file

@ -0,0 +1,6 @@
.vscode
.env
.git
node_modules
dist
Dockerfile

26
.eslintrc Normal file
View file

@ -0,0 +1,26 @@
{
"env": {
"commonjs": true,
"es2021": true,
"node": true
},
"extends": [
"google"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"max-len": "off",
"comma-dangle": "off",
"require-jsdoc": "off",
"indent": ["error", 2],
"padded-blocks": ["warn", { "classes": "always", "switches": "never", "blocks": "never" }],
"linebreak-style": "off",
"arrow-parens": ["warn", "as-needed"]
}
}

11
.gitignore vendored Normal file
View file

@ -0,0 +1,11 @@
.vscode/
node_modules/
dist/
.env
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

28
Dockerfile Normal file
View file

@ -0,0 +1,28 @@
FROM node:14-alpine as build
WORKDIR /builder
COPY package.json yarn.lock ./
RUN yarn install --pure-lockfile
COPY . .
RUN yarn build
FROM node:14-alpine
ENV NODE_ENV=production
ENV PORT=3000
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --pure-lockfile
COPY --from=build /builder/dist ./dist
EXPOSE ${PORT}
CMD [ "node", "dist/index.js" ]

12
nodemon.json Normal file
View file

@ -0,0 +1,12 @@
{
"restartable": "rs",
"ignore": [".git", "node_modules/", "dist/"],
"watch": ["src/"],
"execMap": {
"ts": "node -r ts-node/register"
},
"env": {
"NODE_ENV": "development"
},
"ext": "ts,js,json"
}

27
package.json Normal file
View file

@ -0,0 +1,27 @@
{
"name": "project",
"version": "1.0.0",
"description": "",
"keywords": [],
"license": "MIT",
"author": "nezu",
"main": "dist/index.js",
"scripts": {
"start": "ts-node src/index.ts",
"dev": "nodemon --config nodemon.json src/index.ts",
"dev:debug": "nodemon --config nodemon.json --inspect-brk src/index.ts",
"lint": "eslint . --ext .ts",
"build": "tsc"
},
"devDependencies": {
"@types/node": "^16.10.3",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.0",
"eslint-config-google": "^0.14.0",
"nodemon": "^2.0.13",
"ts-node": "^10.3.0",
"typescript": "^4.4.3"
},
"dependencies": {}
}

1
src/index.ts Normal file
View file

@ -0,0 +1 @@
console.log('Hello World');

20
tsconfig.json Normal file
View file

@ -0,0 +1,20 @@
{
"compilerOptions": {
"lib": [
"es5",
"es6",
"ES2016",
"ES2018",
],
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"outDir": "./dist",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"sourceMap": true
},
"include": [
"src/**/*"
],
}

1574
yarn.lock Normal file

File diff suppressed because it is too large Load diff