Remove docker stuff

This commit is contained in:
Hri7566 2024-09-02 16:19:44 -04:00
parent 4733ca5139
commit 71c2f1b3d6
7 changed files with 5 additions and 72 deletions

View File

@ -1,13 +0,0 @@
node_modules
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
.env.template
.gitmodules
.prettierrc
.eslintrc.js

View File

@ -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", "." ]

View File

@ -10,6 +10,8 @@ maxDuration: 60000
# The default duration of a notification in milliseconds, if not specified. # The default duration of a notification in milliseconds, if not specified.
defaultDuration: 7000 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 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 allTarget: all

2
scripts/dev.sh Executable file
View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
bun .

View File

@ -1,3 +0,0 @@
#!/usr/bin/env bash
docker build --pull -t mpp-server-dev2 . && docker run -p 8443:8443 mpp-server-dev2

View File

@ -19,7 +19,6 @@ import { loadForcedStartupChannels } from "./channel/forceLoad";
import { Logger } from "./util/Logger"; import { Logger } from "./util/Logger";
// docker hates this next one // docker hates this next one
import { startReadline } from "./util/readline"; import { startReadline } from "./util/readline";
import { startMetricsServer } from "./util/metrics";
// wrapper for some reason // wrapper for some reason
export function startServer() { export function startServer() {
@ -37,4 +36,3 @@ export function startServer() {
} }
startServer(); startServer();
startMetricsServer();

View File

@ -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);
}