Update to v 0.0.4

This commit is contained in:
2023-05-04 11:17:52 -04:00
parent 5f69193b81
commit c2d9f8be5a
5 changed files with 46 additions and 35 deletions

View File

@@ -107,7 +107,6 @@ steps:
- yarn install --frozen-lockfile - yarn install --frozen-lockfile
- cp -r /drone/grow/* . - cp -r /drone/grow/* .
- yarn build - yarn build
- name: Publish NPM - name: Publish NPM
image: plugins/npm image: plugins/npm
settings: settings:
@@ -115,21 +114,15 @@ steps:
registry: git.mifi.dev registry: git.mifi.dev
token: token:
- from_secret: gitea_token - from_secret: gitea_token
- name: Build Image
image: docker
commands:
- docker compose build
- name: Publish Image - name: Publish Image
image: plugins/docker image: plugins/docker
settings: settings:
auto_tag: true auto_tag: true
squash: true
repo: git.mifi.dev/mifi/auth repo: git.mifi.dev/mifi/auth
registry: git.mifi.dev registry: git.mifi.dev
ssh-agent-key: ssh-agent-key:
from_secret: gitea_token from_secret: gitea_token
- name: Send Status Notifications - name: Send Status Notifications
image: plugins/webhook image: plugins/webhook
settings: settings:
@@ -167,24 +160,16 @@ workspace:
# - from_secret: gitea_token # - from_secret: gitea_token
steps: steps:
- name: Build Container
image: node:latest
commands:
- cp /drone/grow/package.json ./
- cp /drone/grow/yarn.lock ./
- yarn install --frozen-lockfile
- cp -r /drone/grow/* .
- yarn build
- name: Deploy Container - name: Deploy Container
image: docker image: docker
commands: commands:
- compose build . - compose build .
- compose up -d - compose up -d
volumes: # volumes:
- name: env # - name: env
path: ./.env # path: ./.env
- name: dockersock # - name: dockersock
Path: /var/run/docker.sock # Path: /var/run/docker.sock
- name: Send Status Notifications - name: Send Status Notifications
image: plugins/webhook image: plugins/webhook
settings: settings:
@@ -202,6 +187,16 @@ steps:
- failure - failure
volumes: volumes:
- /volume1/docker/labs/grow-auth/.env:.env
- /var/run/docker.sock:/var/run/docker.sock
- /volume1/docker/labs/grow-auth/dockerconfig.json:.docker/config.json
# - name: env
# host:
# path: /volume1/docker/labs/grow-auth/.env
# - name: dockersock
# host:
# path: /var/run/docker.sock
depends_on: depends_on:
- Build Pipeline - Build Pipeline
@@ -211,11 +206,3 @@ trigger:
- main - main
event: event:
- tag - tag
- name: env
host:
path: /volume1/docker/labs/grow-auth/.env
- name: dockersock
host:
path: /var/run/docker.sock

View File

@@ -1,2 +1,27 @@
FROM node # FROM node:20-alpine AS build
CMD ["node", "dist/lib/server/index.js"] # RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
# WORKDIR /home/node/app
# COPY package*.json .
# COPY dist/lib .
# USER node
# RUN yarn install --frozen-lockfile --production
# COPY --chown=node:node node_modules ./node_modules
# CMD ["node", "dist/lib/server/index.js"]
FROM node:20-alpine AS build
WORKDIR /home/node/app
COPY package*.json ./
COPY tsconfig.json ./
COPY lib ./lib
RUN ls -a
RUN yarn install
RUN yarn build:production
## this is stage two , where the app actually runs
FROM node:20-alpine AS containerize
WORKDIR /home/node/app
COPY package*.json ./
RUN yarn install --frozen-lockfile --production
COPY --from=0 /home/node/app/dist .
EXPOSE 80
CMD ["node","server/index.js"]

View File

@@ -12,7 +12,6 @@ services:
- docknet - docknet
volumes: volumes:
- '/volume1/docker/labs/grow-auth/mongo:/data/db' - '/volume1/docker/labs/grow-auth/mongo:/data/db'
# - '/var/tmp/grow/mongo:/data/db'
restart: unless-stopped restart: unless-stopped
image: mongo image: mongo
auth-service: auth-service:
@@ -48,7 +47,6 @@ services:
volumes: volumes:
- '/Volume1/docker/.yarnrc.yml:/.yarnrc.yml' - '/Volume1/docker/.yarnrc.yml:/.yarnrc.yml'
- '/Volume1/docker/labs/grow-auth/.env:/.env' - '/Volume1/docker/labs/grow-auth/.env:/.env'
# - '~/Projects/Grow/auth/.env:/.env'
restart: unless-stopped restart: unless-stopped
image: node image: node
depends_on: depends_on:

View File

@@ -1,10 +1,11 @@
{ {
"name": "@mifi/auth", "name": "@mifi/auth",
"version": "0.0.3", "version": "0.0.4",
"author": "mifi (Mike Fitzpatrick)", "author": "mifi (Mike Fitzpatrick)",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"build:production": "tsc -p .",
"format": "prettier:fix && lint:fix", "format": "prettier:fix && lint:fix",
"lint": "eslint --ext .ts,.tsx lib/", "lint": "eslint --ext .ts,.tsx lib/",
"lint:fix": "eslint --fix --ext .ts,.tsx lib/", "lint:fix": "eslint --fix --ext .ts,.tsx lib/",

View File

@@ -6,7 +6,7 @@
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"noImplicitAny": true, "noImplicitAny": true,
"outDir": "./dist/", "outDir": "./dist/",
"rootDirs": ["lib", "../"], "rootDirs": ["lib"],
"sourceMap": true "sourceMap": true
} }
} }