Skip to content

Commit b7781a2

Browse files
committed
TFO-Core fixing container ci pipeline
1 parent dab5e34 commit b7781a2

6 files changed

Lines changed: 281 additions & 35 deletions

File tree

.dockerignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ node_modules
22
dist
33
.git
44
.gitignore
5+
README.md
6+
CHANGELOG.md
7+
CONTRIBUTING.md
8+
SECURITY.md
59
*.md
10+
!docs/**/*.md
611
.env
712
.env.*
813
!.env.example
@@ -15,3 +20,6 @@ coverage
1520
*.swo
1621
*~
1722
.DS_Store
23+
.kiro
24+
scripts
25+
logs

.github/workflows/docker.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
- name: Set up Node.js
9797
uses: actions/setup-node@v4
9898
with:
99-
node-version: '18'
99+
node-version: '25'
100100

101101
- name: Install pnpm
102102
uses: pnpm/action-setup@v4
@@ -194,7 +194,7 @@ jobs:
194194
# =============================================================================
195195
# TelemetryFlow Core - Multi-stage Dockerfile
196196
# =============================================================================
197-
FROM node:18-alpine AS builder
197+
FROM node:25-alpine AS builder
198198
199199
ARG VERSION=dev
200200
ARG GIT_COMMIT=unknown
@@ -204,27 +204,27 @@ jobs:
204204
WORKDIR /build
205205
206206
# Install build dependencies
207-
RUN apk add --no-cache git make python3 g++
207+
RUN apk add --no-cache python3 g++
208208
209209
# Install pnpm
210210
RUN npm install -g pnpm@10.24.0
211211
212-
# Copy package files and Makefile
213-
COPY package.json pnpm-lock.yaml Makefile ./
212+
# Copy package files
213+
COPY package.json pnpm-lock.yaml ./
214214
215-
# Install dependencies using Makefile
216-
RUN make ci-install
215+
# Install dependencies
216+
RUN pnpm install --frozen-lockfile
217217
218218
# Copy source
219219
COPY . .
220220
221-
# Build application using Makefile
222-
RUN make ci-build
221+
# Build application
222+
RUN pnpm build
223223
224224
# =============================================================================
225225
# Final image
226226
# =============================================================================
227-
FROM node:18-alpine
227+
FROM node:25-alpine
228228
229229
# Update packages to get security patches (CVE fixes)
230230
RUN apk upgrade --no-cache && \
@@ -380,16 +380,16 @@ jobs:
380380
run: |
381381
# Create Dockerfile for scanning
382382
cat > Dockerfile << 'EOF'
383-
FROM node:18-alpine AS builder
383+
FROM node:25-alpine AS builder
384384
WORKDIR /build
385-
RUN apk add --no-cache git make python3 g++
385+
RUN apk add --no-cache python3 g++
386386
RUN npm install -g pnpm@10.24.0
387-
COPY package.json pnpm-lock.yaml Makefile ./
388-
RUN make ci-install
387+
COPY package.json pnpm-lock.yaml ./
388+
RUN pnpm install --frozen-lockfile
389389
COPY . .
390-
RUN make ci-build
390+
RUN pnpm build
391391
392-
FROM node:18-alpine
392+
FROM node:25-alpine
393393
RUN apk upgrade --no-cache && \
394394
apk add --no-cache ca-certificates tzdata curl
395395
RUN addgroup -g 1001 -S nodejs && \

Dockerfile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,34 @@ FROM node:25-alpine AS builder
33

44
WORKDIR /app
55

6-
# Install system dependencies including bash and make for Makefile support
7-
RUN apk add --no-cache git make python3 g++ bash
6+
# Install system dependencies
7+
RUN apk add --no-cache python3 g++
88

99
# Install pnpm
10-
RUN npm install -g pnpm
10+
RUN npm install -g pnpm@10.24.0
1111

12-
# Copy package files and Makefile
13-
COPY package.json pnpm-lock.yaml Makefile ./
12+
# Copy package files
13+
COPY package.json pnpm-lock.yaml ./
1414

15-
# Install dependencies using Makefile
16-
RUN make ci-install
15+
# Install dependencies
16+
RUN pnpm install --frozen-lockfile
1717

1818
# Copy source code
1919
COPY . .
2020

2121
# Build the application
22-
RUN make ci-build
22+
RUN pnpm build
2323

2424
# Production stage
2525
FROM node:25-alpine
2626

2727
WORKDIR /app
2828

29-
# Install system dependencies including bash for proper shell support
30-
RUN apk add --no-cache dumb-init wget bash
29+
# Install system dependencies
30+
RUN apk add --no-cache dumb-init wget
3131

3232
# Install pnpm
33-
RUN npm install -g pnpm
33+
RUN npm install -g pnpm@10.24.0
3434

3535
# Create non-root user
3636
RUN addgroup -g 1001 -S nodejs && \

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
# Variables
1414
PRODUCT_NAME := TelemetryFlow Core
15-
VERSION := $(shell node -p "require('./package.json').version")
16-
GIT_COMMIT := $(shell git rev-parse --short HEAD)
17-
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
18-
BUILD_TIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ')
15+
VERSION := $(shell node -p "require('./package.json').version" 2>/dev/null || echo "unknown")
16+
GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
17+
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "unknown")
18+
BUILD_TIME := $(shell date -u '+%Y-%m-%dT%H:%M:%SZ' 2>/dev/null || echo "unknown")
1919

2020
# Docker
2121
REGISTRY := docker.io

docker-compose.yml

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
#================================================================================================
22
# TelemetryFlow Core - Docker Compose Configuration
33
# IAM Module Only (PostgreSQL + Backend)
4+
#
5+
# PROFILES:
6+
# - core: Essential services (postgres, clickhouse, backend) - No monitoring
7+
# - monitoring: Observability stack (otel-collector, jaeger, prometheus, grafana)
8+
# - tools: Management tools (portainer)
9+
# - all: All services combined
10+
#
11+
# USAGE:
12+
# docker-compose --profile core up -d # Core services only
13+
# docker-compose --profile core --profile monitoring up -d # Core + monitoring
14+
# docker-compose --profile all up -d # All services
415
#================================================================================================
516

617
#================================================================================================
@@ -85,10 +96,75 @@ services:
8596
start_period: 10s
8697

8798
#----------------------------------------------------------------------------------------------
88-
# BACKEND - NestJS API
99+
# BACKEND - NestJS API (Core Profile - No OTEL dependency)
89100
#----------------------------------------------------------------------------------------------
90101
backend:
91-
profiles: ["core", "all"]
102+
profiles: ["core"]
103+
platform: linux/amd64
104+
build:
105+
context: .
106+
dockerfile: Dockerfile
107+
container_name: ${CONTAINER_BACKEND:-telemetryflow_core_backend}
108+
restart: unless-stopped
109+
ports:
110+
- "${PORT:-3000}:3000"
111+
environment:
112+
- NODE_ENV=${NODE_ENV:-production}
113+
- PORT=3000
114+
- TZ=${TZ:-UTC}
115+
116+
# PostgreSQL
117+
- POSTGRES_HOST=postgres
118+
- POSTGRES_PORT=5432
119+
- POSTGRES_DB=${POSTGRES_DB:-telemetryflow_db}
120+
- POSTGRES_USERNAME=${POSTGRES_USERNAME:-postgres}
121+
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-telemetryflow123}
122+
123+
# ClickHouse
124+
- CLICKHOUSE_HOST=clickhouse
125+
- CLICKHOUSE_PORT=8123
126+
- CLICKHOUSE_DB=${CLICKHOUSE_DB:-telemetryflow_db}
127+
- CLICKHOUSE_USER=${CLICKHOUSE_USER:-default}
128+
- CLICKHOUSE_PASSWORD=${CLICKHOUSE_PASSWORD:-telemetryflow123}
129+
130+
# JWT
131+
- JWT_SECRET=${JWT_SECRET}
132+
- JWT_EXPIRES_IN=${JWT_EXPIRES_IN:-24h}
133+
- SESSION_SECRET=${SESSION_SECRET}
134+
135+
# Logging
136+
- LOGGER_TYPE=${LOGGER_TYPE:-winston}
137+
- LOG_LEVEL=${LOG_LEVEL:-info}
138+
- LOG_PRETTY_PRINT=${LOG_PRETTY_PRINT:-false}
139+
- LOG_FILE_ENABLED=${LOG_FILE_ENABLED:-true}
140+
- LOG_FILE_DIRNAME=logs
141+
- LOG_FILE_FILENAME=app-%DATE%.log
142+
143+
# OpenTelemetry (disabled for core profile)
144+
- OTEL_ENABLED=false
145+
- OTEL_SERVICE_NAME=${OTEL_SERVICE_NAME:-telemetryflow-core}
146+
volumes:
147+
- ./logs:/app/logs
148+
depends_on:
149+
postgres:
150+
condition: service_healthy
151+
clickhouse:
152+
condition: service_healthy
153+
networks:
154+
telemetryflow_core_net:
155+
ipv4_address: ${CONTAINER_IP_BACKEND:-172.151.151.10}
156+
healthcheck:
157+
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1"]
158+
interval: 30s
159+
timeout: 10s
160+
retries: 3
161+
start_period: 40s
162+
163+
#----------------------------------------------------------------------------------------------
164+
# BACKEND - NestJS API (All Profile - With OTEL dependency)
165+
#----------------------------------------------------------------------------------------------
166+
backend-with-monitoring:
167+
profiles: ["all"]
92168
platform: linux/amd64
93169
build:
94170
context: .
@@ -129,7 +205,7 @@ services:
129205
- LOG_FILE_DIRNAME=logs
130206
- LOG_FILE_FILENAME=app-%DATE%.log
131207

132-
# OpenTelemetry
208+
# OpenTelemetry (enabled for all profile)
133209
- OTEL_ENABLED=${OTEL_ENABLED:-true}
134210
- OTEL_SERVICE_NAME=${OTEL_SERVICE_NAME:-telemetryflow-core}
135211
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
@@ -190,7 +266,7 @@ services:
190266
otel-collector:
191267
profiles: ["monitoring", "all"]
192268
platform: linux/amd64
193-
image: otel/opentelemetry-collector-contrib:${OTEL_VERSION:-latest}
269+
image: telemetryflow/telemetryflow-collector-ocb:${OTEL_VERSION:-latest}
194270
container_name: ${CONTAINER_OTEL:-telemetryflow_core_otel}
195271
restart: unless-stopped
196272
command: ["--config=/etc/otel-collector-config.yaml"]

0 commit comments

Comments
 (0)