Remove docker stuff
This commit is contained in:
parent
4733ca5139
commit
71c2f1b3d6
|
@ -1,13 +0,0 @@
|
|||
node_modules
|
||||
Dockerfile*
|
||||
docker-compose*
|
||||
.dockerignore
|
||||
.git
|
||||
.gitignore
|
||||
README.md
|
||||
LICENSE
|
||||
.vscode
|
||||
.env.template
|
||||
.gitmodules
|
||||
.prettierrc
|
||||
.eslintrc.js
|
16
Dockerfile
16
Dockerfile
|
@ -1,16 +0,0 @@
|
|||
FROM oven/bun:latest AS base
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY src src
|
||||
COPY public public
|
||||
COPY config config
|
||||
COPY *.json ./
|
||||
COPY mppkey ./mppkey
|
||||
|
||||
RUN bun install
|
||||
RUN bunx prisma generate
|
||||
|
||||
# Mount ./prisma to /usr/src/app/prisma
|
||||
|
||||
EXPOSE 8443/tcp
|
||||
ENTRYPOINT [ "bun", "." ]
|
|
@ -10,6 +10,8 @@ maxDuration: 60000
|
|||
# The default duration of a notification in milliseconds, if not specified.
|
||||
defaultDuration: 7000
|
||||
|
||||
# The target used to send notifications to every socket on the server.
|
||||
# The target ID to use to send notifications to every socket on the server.
|
||||
# This is not used for the "target" parameter, instead this is for "targetChannel"/"targetUser".
|
||||
# This will allow notifications to be sent to every socket on the server.
|
||||
# This is configurable because it's potentially dangerous to allow every
|
||||
allTarget: all
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
#!/usr/bin/env bash
|
||||
bun .
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
docker build --pull -t mpp-server-dev2 . && docker run -p 8443:8443 mpp-server-dev2
|
|
@ -19,7 +19,6 @@ import { loadForcedStartupChannels } from "./channel/forceLoad";
|
|||
import { Logger } from "./util/Logger";
|
||||
// docker hates this next one
|
||||
import { startReadline } from "./util/readline";
|
||||
import { startMetricsServer } from "./util/metrics";
|
||||
|
||||
// wrapper for some reason
|
||||
export function startServer() {
|
||||
|
@ -37,4 +36,3 @@ export function startServer() {
|
|||
}
|
||||
|
||||
startServer();
|
||||
startMetricsServer();
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
import client, { Registry } from "prom-client";
|
||||
import { Logger } from "./Logger";
|
||||
|
||||
const logger = new Logger("Metrics Server");
|
||||
|
||||
export function startMetricsServer() {
|
||||
client.collectDefaultMetrics();
|
||||
logger.info("Starting Prometheus metrics server...");
|
||||
|
||||
const server = Bun.serve({
|
||||
port: 9100,
|
||||
async fetch(req) {
|
||||
const res = new Response(await client.register.metrics());
|
||||
res.headers.set("Content-Type", client.register.contentType);
|
||||
return res;
|
||||
}
|
||||
});
|
||||
|
||||
enableMetrics();
|
||||
}
|
||||
|
||||
export const metrics = {
|
||||
concurrentUsers: new client.Histogram({
|
||||
name: "concurrent_users",
|
||||
help: "Number of concurrent users",
|
||||
}),
|
||||
callbacks: [],
|
||||
addCallback(callback: (...args: any[]) => void | Promise<void>) {
|
||||
(this.callbacks as ((...args: any[]) => void)[]).push(callback);
|
||||
}
|
||||
}
|
||||
|
||||
function enableMetrics() {
|
||||
setInterval(() => {
|
||||
(metrics.callbacks as ((...args: any[]) => void)[]).forEach(callback => callback());
|
||||
}, 5000);
|
||||
}
|
Loading…
Reference in New Issue