chore: publish current DataStack updates
Publish the current application, design, and Phase 1 deployment updates. Excludes ignored personal notes, local MCP config, and generated TypeScript build info.
This commit is contained in:
1 parent
d39d9f92f9
commit
fcc4f4db2d
88 files changed
+21248
-2213
No files matched your search
@@ -0,0 +1,16 @@
|
||||
FROM node:22-alpine AS dependencies
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
FROM node:22-alpine AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT_SOCKET=4000
|
||||
RUN mkdir -p /app/storage/data \
|
||||
&& chown -R node:node /app/storage
|
||||
COPY --from=dependencies --chown=node:node /app/node_modules ./node_modules
|
||||
COPY --chown=node:node server ./server
|
||||
USER node
|
||||
EXPOSE 4000
|
||||
CMD ["node", "server/index.js"]
|
||||
@@ -0,0 +1,28 @@
|
||||
FROM node:22-alpine AS dependencies
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
COPY --from=dependencies /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-alpine AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
RUN addgroup -S -g 1001 nodejs \
|
||||
&& adduser -S -u 1001 -G nodejs nextjs
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
RUN mkdir -p /app/storage/data \
|
||||
&& chown -R nextjs:nodejs /app/storage
|
||||
USER nextjs
|
||||
EXPOSE 3000
|
||||
CMD ["node", "server.js"]
|
||||
+51
-24
@@ -1,5 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# Next.js Frontend & Admin Console (Port 3000)
|
||||
web:
|
||||
@@ -9,13 +7,26 @@ services:
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DATASTACK_JWT_SECRET=datastack-universal-secret-key-2026
|
||||
- DATABASE_URL=postgresql://datastack:securepass@postgres:5432/datastack_db
|
||||
NODE_ENV: production
|
||||
PORT: "3000"
|
||||
DATASTACK_JWT_SECRET: "${DATASTACK_JWT_SECRET:?Set DATASTACK_JWT_SECRET in .env}"
|
||||
DATASTACK_ADMIN_EMAIL: "${DATASTACK_ADMIN_EMAIL:?Set DATASTACK_ADMIN_EMAIL in .env}"
|
||||
DATASTACK_ADMIN_PASSWORD: "${DATASTACK_ADMIN_PASSWORD:?Set DATASTACK_ADMIN_PASSWORD in .env}"
|
||||
DATASTACK_ADMIN_SESSION_SECRET: "${DATASTACK_ADMIN_SESSION_SECRET:?Set DATASTACK_ADMIN_SESSION_SECRET in .env}"
|
||||
DATABASE_URL: "${DATABASE_URL:?Set DATABASE_URL in .env}"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- redis
|
||||
- postgres
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"node",
|
||||
"-e",
|
||||
"fetch('http://127.0.0.1:3000/').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))",
|
||||
]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
|
||||
# Express + Socket.IO Ingestion Engine (Port 4000)
|
||||
ingestion:
|
||||
@@ -25,35 +36,51 @@ services:
|
||||
ports:
|
||||
- "4000:4000"
|
||||
volumes:
|
||||
- ../storage:/app/storage
|
||||
- datastack-data:/app/storage
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT_SOCKET=4000
|
||||
- DATASTACK_JWT_SECRET=datastack-universal-secret-key-2026
|
||||
- REDIS_URL=redis://redis:6379
|
||||
NODE_ENV: production
|
||||
PORT_SOCKET: "4000"
|
||||
DATASTACK_JWT_SECRET: "${DATASTACK_JWT_SECRET:?Set DATASTACK_JWT_SECRET in .env}"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- redis
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"node",
|
||||
"-e",
|
||||
"fetch('http://127.0.0.1:4000/health').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))",
|
||||
]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
|
||||
# Redis In-Memory Buffer Broker
|
||||
# Reserved for the planned shared buffer integration; not consumed by the current runtime.
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
ports:
|
||||
- "6379:6379"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
|
||||
# PostgreSQL for Admin Metadata Only (NOT collected data)
|
||||
# Reserved for the planned metadata integration; not consumed by the current runtime.
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
- POSTGRES_USER=datastack
|
||||
- POSTGRES_PASSWORD=securepass
|
||||
- POSTGRES_DB=datastack_db
|
||||
POSTGRES_USER: datastack
|
||||
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}"
|
||||
POSTGRES_DB: datastack_db
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "5432:5432"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U datastack -d datastack_db"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
datastack-data:
|
||||
pgdata:
|
||||
+17
-5
@@ -1,8 +1,20 @@
|
||||
# Docker Deployment Manifest
|
||||
|
||||
## Purpose
|
||||
Containerization specs for the split architecture runtime:
|
||||
- `web`: Next.js frontend + Admin console on Port 3000
|
||||
- `ingestion`: Express + Socket.IO process on Port 4000
|
||||
- `redis`: In-memory buffer broker and pub/sub
|
||||
- `postgres`: Dedicated database for administrative metadata and client registrations (no collected data)
|
||||
|
||||
Production container definitions for the split architecture:
|
||||
|
||||
- `web`: standalone Next.js frontend and admin console on port 3000, running as a non-root user.
|
||||
- `ingestion`: Express + Socket.IO process on port 4000, running as a non-root user.
|
||||
- `redis`: private Compose service reserved for the planned shared-buffer integration; current application code does not consume it.
|
||||
- `postgres`: private Compose service reserved for metadata integration; current application code does not use Prisma at runtime. Collected events must remain in CSV files.
|
||||
|
||||
## Build and Run
|
||||
|
||||
- Run from the repository root with Docker Engine and the Compose plugin installed.
|
||||
- Copy `.env.example` to `.env` and provide non-empty deployment values; Compose deliberately has no committed secret defaults.
|
||||
- Validate and start with `docker compose --env-file .env -f docker/docker-compose.yml config` and `docker compose --env-file .env -f docker/docker-compose.yml up --build -d`.
|
||||
- Only the web and ingestion ports are published. PostgreSQL and Redis remain private to the Compose network.
|
||||
- The `datastack-data` named volume persists ingestion CSVs; `pgdata` persists PostgreSQL files.
|
||||
- The web container does not yet share/read `datastack-data`, and neither Redis nor PostgreSQL is wired into runtime code. Those are later roadmap phases, so cross-process reads and metadata durability are not established by these images.
|
||||
- Health checks probe the public landing route, ingestion `/health`, Redis ping, and PostgreSQL readiness. These checks do not establish application-level shared-storage readiness.
|
||||
Reference in new issue
Block a user