mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Add multi-service Docker setup, Postgres migrations, and messaging API cleanup
This commit is contained in:
@@ -33,7 +33,10 @@ RUN npm run build
|
||||
# 3. Put it all together
|
||||
FROM node:24-slim
|
||||
|
||||
# 3.1. Non-root user
|
||||
# 3.1. Install curl for health checks
|
||||
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 3.2. Non-root user
|
||||
RUN useradd -u 1001 app && \
|
||||
mkdir -p /app && \
|
||||
chown -R app /app && \
|
||||
|
||||
@@ -5,6 +5,7 @@ import { resolve } from 'path';
|
||||
const app = express();
|
||||
const port = process.env.PORT || 3000;
|
||||
const backendHost = process.env.BACKEND_HOST || "http://localhost:8300";
|
||||
const fileStorageHost = process.env.FILE_STORAGE_HOST || "http://localhost:8302";
|
||||
const filePath = process.env.STATIC_FILE_PATH || ".";
|
||||
|
||||
// API proxy middleware
|
||||
@@ -15,6 +16,12 @@ app.use('/api', createProxyMiddleware({
|
||||
ws: true
|
||||
}));
|
||||
|
||||
// File serving proxy middleware
|
||||
app.use('/uploads/files', createProxyMiddleware({
|
||||
target: fileStorageHost,
|
||||
changeOrigin: true
|
||||
}));
|
||||
|
||||
// Serve static files
|
||||
app.use(express.static(resolve(filePath)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user