feat(logging): finalize log-ingest service for dokploy-network deployment
- Update log-ingest to use internal Loki endpoint - Add standalone docker-compose for dokploy deployment - Update ROADMAP and LOGGING-PLAN with completed status - Configure proper network settings for dokploy-network
This commit is contained in:
@@ -50,7 +50,7 @@ services:
|
||||
image: prom/prometheus:v2.47.0
|
||||
container_name: ai-stack-prometheus
|
||||
ports:
|
||||
- "9090:9090"
|
||||
- "9091:9090"
|
||||
volumes:
|
||||
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- ./alerting:/etc/prometheus/alerting:ro
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
FROM oven/bun:1.0
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json bun.lockb* ./
|
||||
RUN bun install --frozen-lockfile 2>/dev/null || bun install
|
||||
COPY package.json ./
|
||||
RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV PORT=3000
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["bun", "run", "src/index.ts"]
|
||||
CMD ["npx", "tsx", "src/index.ts"]
|
||||
|
||||
27
logging-stack/log-ingest/docker-compose.yml
Normal file
27
logging-stack/log-ingest/docker-compose.yml
Normal file
@@ -0,0 +1,27 @@
|
||||
# AI Stack Log Ingest Service
|
||||
# Connects to existing Loki at logs.intra.flexinit.nl
|
||||
|
||||
services:
|
||||
log-ingest:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: ai-stack-log-ingest
|
||||
ports:
|
||||
- "3102:3000"
|
||||
environment:
|
||||
# Connect to existing Loki on dokploy-network
|
||||
- LOKI_URL=http://monitor-grafanaloki-qkj16i-loki-1:3100
|
||||
- LOG_LEVEL=info
|
||||
networks:
|
||||
- dokploy-network
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
networks:
|
||||
dokploy-network:
|
||||
external: true
|
||||
@@ -3,14 +3,16 @@
|
||||
"version": "1.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"start": "bun run src/index.ts",
|
||||
"dev": "bun --watch run src/index.ts"
|
||||
"start": "tsx src/index.ts",
|
||||
"dev": "tsx --watch src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"hono": "^4.0.0",
|
||||
"prom-client": "^15.0.0"
|
||||
"prom-client": "^15.0.0",
|
||||
"@hono/node-server": "^1.8.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "latest"
|
||||
"tsx": "^4.7.0",
|
||||
"@types/node": "^20.0.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { Hono } from 'hono';
|
||||
import { cors } from 'hono/cors';
|
||||
import { logger } from 'hono/logger';
|
||||
import { serve } from '@hono/node-server';
|
||||
import { Registry, Counter, Histogram, Gauge, collectDefaultMetrics } from 'prom-client';
|
||||
|
||||
const app = new Hono();
|
||||
@@ -193,7 +194,7 @@ app.post('/ingest/batch', async (c) => {
|
||||
const port = parseInt(process.env.PORT || '3000');
|
||||
console.log(`Log ingest service starting on port ${port}`);
|
||||
|
||||
export default {
|
||||
port,
|
||||
fetch: app.fetch
|
||||
};
|
||||
serve({
|
||||
fetch: app.fetch,
|
||||
port
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user