Made the schema for the lighthouse metrics.
This commit is contained in:
1 parent
f3aa0173b3
commit
19861f3253
8 files changed
+82
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
./docker
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
version: "3"
|
||||||
|
services:
|
||||||
|
server:
|
||||||
|
image: uptime_server:latest
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
depends_on:
|
||||||
|
- redis
|
||||||
|
- mongodb
|
||||||
|
redis:
|
||||||
|
image: uptime_redis:latest
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- ./redis/data:/data
|
||||||
|
mongodb:
|
||||||
|
image: uptime_database_mongo:latest
|
||||||
|
command: ["mongod", "--quiet"]
|
||||||
|
ports:
|
||||||
|
- "27017:27017"
|
||||||
|
volumes:
|
||||||
|
- ./mongo/data:/data/db
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
FROM mongo
|
||||||
|
EXPOSE 27017
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
FROM mongo
|
||||||
|
EXPOSE 27017
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
FROM redis
|
||||||
|
EXPOSE 6379
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
FROM redis
|
||||||
|
EXPOSE 6379
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
FROM node:20
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ../../package*.json ./
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY ../../ ./
|
||||||
|
|
||||||
|
EXPOSE 5000
|
||||||
|
|
||||||
|
CMD ["node", "index.js"]
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
const mongoose = require("mongoose");
|
||||||
|
|
||||||
|
const MetricsSchema = mongoose.Schema(
|
||||||
|
{
|
||||||
|
monitorId: {
|
||||||
|
type: mongoose.Schema.Types.ObjectId,
|
||||||
|
ref: "Monitor",
|
||||||
|
immutable: true,
|
||||||
|
},
|
||||||
|
accessibility: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
bestPractices: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
seo: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
performance: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
timestamp: {
|
||||||
|
type: Date,
|
||||||
|
default: Date.now,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
timestamps: true,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = mongoose.model("LighthouseMetrics", MetricsSchema);
|
||||||
Reference in new issue
Block a user