Restructuring the folders #1
37
.drone.yml
37
.drone.yml
@@ -7,9 +7,15 @@ workspace:
|
||||
|
||||
steps:
|
||||
- name: yarn install
|
||||
image: node:latest
|
||||
image: node:20-bullseye-slim
|
||||
environment:
|
||||
YARN_VERSION: 3.5.0
|
||||
commands:
|
||||
- yarn set version stable
|
||||
- yarn install
|
||||
volumes:
|
||||
- name: yarnrc
|
||||
path: /drone/auth/.yarnrc.yml
|
||||
- name: Code Style Checks
|
||||
image: node:latest
|
||||
commands:
|
||||
@@ -40,7 +46,7 @@ steps:
|
||||
- name: Build
|
||||
image: node:latest
|
||||
commands:
|
||||
- yarn build
|
||||
- yarn build:production
|
||||
- name: Send Build Status Notifications
|
||||
image: plugins/webhook
|
||||
settings:
|
||||
@@ -57,6 +63,11 @@ steps:
|
||||
- success
|
||||
- failure
|
||||
|
||||
volumes:
|
||||
- name: yarnrc
|
||||
host:
|
||||
path: /volume1/docker/.yarnrc.yml
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
- main
|
||||
@@ -74,18 +85,24 @@ workspace:
|
||||
|
||||
steps:
|
||||
- name: Build Package
|
||||
image: node:latest
|
||||
image: node:20-bullseye-slim
|
||||
environment:
|
||||
YARN_VERSION: 3.5.0
|
||||
commands:
|
||||
- yarn install
|
||||
- yarn build
|
||||
- yarn set version stable
|
||||
- yarn install
|
||||
volumes:
|
||||
- name: yarnrc
|
||||
path: /drone/auth/.yarnrc.yml
|
||||
- name: Publish NPM
|
||||
image: node:20-alpine
|
||||
failure: ignore
|
||||
image: node:20-bullseye-slim
|
||||
commands:
|
||||
- yarn publish -t ${DRONE_TAG}
|
||||
- yarn npm publish
|
||||
volumes:
|
||||
- name: npmrc
|
||||
path: /drone/auth/.npmrc
|
||||
- name: yarnrc
|
||||
path: /drone/auth/.yarnrc.yml
|
||||
- name: Report NPM Publish Status
|
||||
image: plugins/webhook
|
||||
settings:
|
||||
@@ -107,7 +124,6 @@ steps:
|
||||
auto_tag: true
|
||||
repo: git.mifi.dev/mifi/auth-service
|
||||
registry: git.mifi.dev
|
||||
debug: true
|
||||
ssh-agent-key:
|
||||
from_secret: reg_token
|
||||
username: <token>
|
||||
@@ -140,6 +156,9 @@ volumes:
|
||||
- name: npmrc
|
||||
host:
|
||||
path: /volume1/docker/beethoven/labs-auth/.npmrc
|
||||
- name: yarnrc
|
||||
host:
|
||||
path: /volume1/docker/.yarnrc.yml
|
||||
|
||||
depends_on:
|
||||
- Test Pipeline
|
||||
|
||||
@@ -11,7 +11,7 @@ module.exports = {
|
||||
plugins: ['@typescript-eslint'],
|
||||
settings: {
|
||||
'import/parsers': {
|
||||
'@typescript-eslint/parser': [".ts", ".tsx"],
|
||||
'@typescript-eslint/parser': ['.ts', '.tsx'],
|
||||
},
|
||||
'import/resolver': 'typescript',
|
||||
},
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -130,3 +130,6 @@ dist
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
# Project
|
||||
lib/
|
||||
dist/
|
||||
|
||||
12
.npmignore
Normal file
12
.npmignore
Normal file
@@ -0,0 +1,12 @@
|
||||
.build.yarnrc.yml
|
||||
.drone.yml
|
||||
.env*
|
||||
.eslintrc*
|
||||
.npmrc
|
||||
.prettierrc*
|
||||
.yarnrc.yml
|
||||
babel.config.*
|
||||
jest.config.*
|
||||
src
|
||||
tsconfig*.json
|
||||
tslint.json
|
||||
873
.yarn/releases/yarn-3.5.1.cjs
vendored
Executable file
873
.yarn/releases/yarn-3.5.1.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
@@ -1 +1,3 @@
|
||||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-3.5.1.cjs
|
||||
|
||||
12
Dockerfile
12
Dockerfile
@@ -15,10 +15,10 @@ ENV NODE_ENV development
|
||||
ENV NPM_TOKEN $NPM_TOKEN
|
||||
WORKDIR /home/node/app
|
||||
COPY .npmrc /root
|
||||
COPY .yarnrc.build.yml /root/.yarnrc.yml
|
||||
COPY lib package*.json tsconfig.json yarn.lock ./
|
||||
COPY .build.yarnrc.yml /root/.yarnrc.yml
|
||||
COPY . .
|
||||
RUN yarn set version stable && yarn install
|
||||
RUN yarn build
|
||||
RUN yarn build:production
|
||||
|
||||
## this is stage two , where the app actually runs
|
||||
FROM node:20-bullseye-slim AS containerize
|
||||
@@ -27,9 +27,9 @@ ENV NODE_ENV $ENV
|
||||
ENV NPM_TOKEN $NPM_TOKEN
|
||||
WORKDIR /home/node/app
|
||||
COPY .npmrc /root
|
||||
COPY .yarnrc.build.yml /root/.yarnrc.yml
|
||||
COPY .build.yarnrc.yml /root/.yarnrc.yml
|
||||
COPY package*.json yarn.lock ./
|
||||
RUN yarn set version stable && yarn install && yarn cache clean
|
||||
COPY --from=build /home/node/app/dist .
|
||||
COPY --from=build /home/node/app/dist ./
|
||||
EXPOSE $PORT
|
||||
CMD ["node","server/index.js"]
|
||||
CMD ["node","index.js"]
|
||||
|
||||
@@ -17,7 +17,7 @@ services:
|
||||
- auth-db:/data/db
|
||||
- auth-db:/data/configdb
|
||||
restart: unless-stopped
|
||||
image: mongo:latest
|
||||
image: ${CONTAINER_PREFIX}-auth-service_mongo:${TAG:-latest}
|
||||
auth-service:
|
||||
env_file: .env.dev
|
||||
build:
|
||||
@@ -37,7 +37,7 @@ services:
|
||||
- labs-net
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
image: node:20-alpine
|
||||
image: ${CONTAINER_PREFIX}-auth-service:${TAG:-latest}
|
||||
depends_on:
|
||||
- auth-service_mongo
|
||||
networks:
|
||||
|
||||
@@ -16,7 +16,7 @@ services:
|
||||
- 'auth-db:/data/db'
|
||||
- 'auth-db:/data/configdb'
|
||||
restart: unless-stopped
|
||||
image: mongo:4.4
|
||||
image: ${CONTAINER_PREFIX}auth-service_mongo:${DRONE_TAG:-latest}
|
||||
auth-service:
|
||||
container_name: ${CONTAINER_PREFIX}-auth-service
|
||||
env_file:
|
||||
@@ -42,7 +42,7 @@ services:
|
||||
- auth-backend
|
||||
- docknet
|
||||
restart: unless-stopped
|
||||
image: node:20-alpine
|
||||
image: ${CONTAINER_PREFIX}auth-service:${DRONE_TAG:-latest}
|
||||
depends_on:
|
||||
- auth-service_mongo
|
||||
networks:
|
||||
|
||||
20
package.json
20
package.json
@@ -1,17 +1,18 @@
|
||||
{
|
||||
"name": "@mifi/auth-service",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"author": "mifi (Mike Fitzpatrick)",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"build:production": "tsc -p .",
|
||||
"build:production": "tsc -p ./tsconfig.production.json",
|
||||
"format": "prettier:fix && lint:fix",
|
||||
"lint": "eslint --ext .ts,.tsx lib/",
|
||||
"lint:fix": "eslint --fix --ext .ts,.tsx lib/",
|
||||
"prettier": "prettier --check 'lib/**/*.ts'",
|
||||
"prettier:fix": "prettier --write 'lib/**/*.ts'",
|
||||
"serve": "node dist/lib/index.js",
|
||||
"lint": "eslint --ext .ts,.tsx src/",
|
||||
"lint:fix": "eslint --fix --ext .ts,.tsx src/",
|
||||
"prettier": "prettier --check 'src/**/*.ts'",
|
||||
"prettier:fix": "prettier --write 'src/**/*.ts'",
|
||||
"serve-dev": "ts-node src/index.ts",
|
||||
"serve": "node lib/index.js",
|
||||
"start": "nodemon",
|
||||
"test": "jest --passWithNoTests"
|
||||
},
|
||||
@@ -80,6 +81,7 @@
|
||||
"description": "",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.mifi.dev/mifi/auth-api.git"
|
||||
}
|
||||
"url": "https://git.mifi.dev/mifi/auth-service.git"
|
||||
},
|
||||
"packageManager": "yarn@3.5.1"
|
||||
}
|
||||
|
||||
@@ -2,11 +2,16 @@
|
||||
"extends": "@tsconfig/node16/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"declaration": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"noImplicitAny": true,
|
||||
"outDir": "./dist/",
|
||||
"rootDirs": ["lib"],
|
||||
"sourceMap": true
|
||||
}
|
||||
"outDir": "dist/",
|
||||
"rootDirs": ["./", "src/"],
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": true,
|
||||
"removeComments": false
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
17
tsconfig.production.json
Normal file
17
tsconfig.production.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"extends": "@tsconfig/node16/tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"declaration": true,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"noImplicitAny": true,
|
||||
"outDir": "dist/",
|
||||
"rootDirs": ["./", "src/"],
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"sourceMap": false,
|
||||
"removeComments": true
|
||||
},
|
||||
"include": ["./src"]
|
||||
}
|
||||
Reference in New Issue
Block a user