@paralect/hive 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paralect/hive",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -14,6 +14,8 @@
14
14
  "@koa/multer": "3.0.0",
15
15
  "@koa/router": "10.1.1",
16
16
  "@paralect/node-mongo": "2.1.1",
17
+ "@react-email/components": "^0.0.20",
18
+ "@react-email/render": "^0.0.16",
17
19
  "@sendgrid/mail": "7.6.1",
18
20
  "@socket.io/redis-adapter": "7.1.0",
19
21
  "@socket.io/redis-emitter": "4.1.1",
@@ -26,7 +28,7 @@
26
28
  "eslint-config-prettier": "8.5.0",
27
29
  "fs-extra": "^11.2.0",
28
30
  "handlebars": "4.7.7",
29
- "joi": "17.6.0",
31
+ "joi": "^17.13.3",
30
32
  "koa": "2.13.4",
31
33
  "koa-bodyparser": "4.3.0",
32
34
  "koa-helmet": "6.1.0",
@@ -40,6 +42,7 @@
40
42
  "moment-duration-format": "2.3.2",
41
43
  "multer": "1.4.4",
42
44
  "node-schedule": "2.1.0",
45
+ "nodemailer": "^6.9.14",
43
46
  "nodemon": "2.0.15",
44
47
  "prettier": "2.6.2",
45
48
  "psl": "1.8.0",
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": ["@babel/preset-env", "@babel/preset-react"]
3
+ }
@@ -1,13 +1,22 @@
1
- FROM --platform=linux/amd64 node:16.13.1-alpine3.13 as base
1
+ FROM node:16.13.1-alpine3.13 as base
2
2
  RUN apk add --no-cache python3 py3-pip
3
3
 
4
- # On staging containers running in development mode
5
- ARG NODE_ENV=development
4
+ ENV NODE_ENV=production
5
+ ENV APP_ENV=production
6
6
 
7
- ARG APP_ENV
8
- ENV NODE_ENV=$NODE_ENV
9
- ENV APP_ENV=$APP_ENV
7
+ WORKDIR /app
8
+ EXPOSE 3001
9
+ COPY ["./package*.json", "/app/"]
10
10
 
11
- WORKDIR /project
11
+ RUN npm set progress=false && npm config set depth 0
12
12
 
13
- CMD npm run dev 2>&1 | tee /project/logs/log.txt
13
+ RUN npm set-script prepare ""
14
+
15
+ RUN npm ci --only=production --quiet
16
+
17
+ COPY ./ ./
18
+
19
+ RUN mkdir -p /project/logs
20
+ RUN touch /project/logs/log.txt
21
+
22
+ CMD npm start 2>&1 | tee /project/logs/log.txt
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+ cd "$( dirname "${BASH_SOURCE[0]}" )"
3
+ cd ..
4
+
5
+ node ./deploy/script/src/index.js
@@ -0,0 +1,6 @@
1
+ apiVersion: v2
2
+ name: hive-api
3
+ description: A Helm chart for Kubernetes
4
+ type: application
5
+ version: 0.1.0
6
+ appVersion: 1.16.0
@@ -0,0 +1,3 @@
1
+ nodePool: pool-app
2
+ containerRegistry: paralect/hive-api
3
+ port: 3001
@@ -0,0 +1,43 @@
1
+ kind: Deployment
2
+ apiVersion: apps/v1
3
+ metadata:
4
+ name: {{ .Values.service }}
5
+ labels:
6
+ app: {{ .Values.service }}
7
+ spec:
8
+ replicas: 1
9
+ selector:
10
+ matchLabels:
11
+ app: {{ .Values.service }}
12
+ template:
13
+ metadata:
14
+ labels:
15
+ app: {{ .Values.service }}
16
+ spec:
17
+ restartPolicy: Always
18
+ containers:
19
+ - name: {{ .Values.service }}
20
+ image: {{ .Values.containerRegistry }}:{{ .Values.imagesVersion }}
21
+ env:
22
+ - name: PROJECT_ID
23
+ value: {{ .Values.projectId }}
24
+ env:
25
+ - name: MONGODB_URI
26
+ value: {{ .Values.mongoDbUri }}
27
+ imagePullPolicy: Always
28
+ livenessProbe:
29
+ httpGet:
30
+ path: /health
31
+ port: {{ .Values.port }}
32
+ initialDelaySeconds: 300
33
+ periodSeconds: 10
34
+ ports:
35
+ - containerPort: {{ .Values.port }}
36
+ protocol: TCP
37
+ nodeSelector:
38
+ doks.digitalocean.com/node-pool: {{ .Values.nodePool }}
39
+ strategy:
40
+ type: RollingUpdate
41
+ rollingUpdate:
42
+ maxUnavailable: 0
43
+ maxSurge: 1
@@ -0,0 +1,26 @@
1
+ kind: Ingress
2
+ apiVersion: networking.k8s.io/v1
3
+ metadata:
4
+ name: {{ .Values.service }}
5
+ labels:
6
+ app: {{ .Values.service }}
7
+ annotations:
8
+ nginx.ingress.kubernetes.io/proxy-read-timeout: "180"
9
+ nginx.ingress.kubernetes.io/proxy-body-size: "20m"
10
+ external-dns.alpha.kubernetes.io/hostname: {{ first .Values.domain }}
11
+ external-dns.alpha.kubernetes.io/ttl: "120" #optional
12
+ spec:
13
+ ingressClassName: nginx
14
+ rules:
15
+ {{- range $domain := .Values.domain }}
16
+ - host: {{ $domain }}
17
+ http:
18
+ paths:
19
+ - path: /
20
+ pathType: Prefix
21
+ backend:
22
+ service:
23
+ name: {{ $.Values.service }}
24
+ port:
25
+ number: {{ $.Values.port }}
26
+ {{- end}}
@@ -0,0 +1,14 @@
1
+
2
+ kind: Service
3
+ apiVersion: v1
4
+ metadata:
5
+ name: {{ .Values.service }}
6
+ labels:
7
+ app: {{ .Values.service }}
8
+ spec:
9
+ type: ClusterIP
10
+ selector:
11
+ app: {{ .Values.service }}
12
+ ports:
13
+ - protocol: TCP
14
+ port: {{ .Values.port }}
@@ -0,0 +1,39 @@
1
+ FROM node:16.13.1-alpine3.13
2
+
3
+ RUN apk add docker
4
+
5
+ ARG VCS_REF
6
+ ARG BUILD_DATE
7
+
8
+ # Metadata
9
+ LABEL org.label-schema.vcs-ref=$VCS_REF \
10
+ org.label-schema.name="helm-kubectl" \
11
+ org.label-schema.url="https://hub.docker.com/r/dtzar/helm-kubectl/" \
12
+ org.label-schema.vcs-url="https://github.com/dtzar/helm-kubectl" \
13
+ org.label-schema.build-date=$BUILD_DATE
14
+
15
+ # Note: Latest version of kubectl may be found at:
16
+ # https://github.com/kubernetes/kubernetes/releases
17
+ ENV KUBE_LATEST_VERSION="v1.22.4"
18
+
19
+ # Note: Latest version of helm may be found at:
20
+ # https://github.com/kubernetes/helm/releases
21
+ ENV HELM_VERSION="v3.7.1"
22
+
23
+ RUN apk add --no-cache ca-certificates bash git openssh curl \
24
+ && wget -q https://storage.googleapis.com/kubernetes-release/release/${KUBE_LATEST_VERSION}/bin/linux/amd64/kubectl -O /usr/local/bin/kubectl \
25
+ && chmod +x /usr/local/bin/kubectl \
26
+ && wget -q https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz -O - | tar -xzO linux-amd64/helm > /usr/local/bin/helm \
27
+ && chmod +x /usr/local/bin/helm
28
+
29
+ WORKDIR /home/node/app
30
+
31
+ ADD ./deploy/script/package.json \
32
+ ./deploy/script/package-lock.json \
33
+ ./deploy/script/
34
+
35
+ RUN npm i --prefix ./deploy/script --progress=false --no-audit --production
36
+
37
+ ADD ./ ./
38
+
39
+ CMD node ./deploy/script/src/index.js