Test CI/CD 3 & fix healthcheck

This commit is contained in:
2026-03-26 20:42:37 +03:00
parent 1276334a62
commit c4ed7e6fc8
10 changed files with 14 additions and 28 deletions

View File

@@ -2,8 +2,8 @@ FROM node:22-bookworm-slim AS builder
WORKDIR /app WORKDIR /app
COPY package.json package-lock.json ./ COPY package*.json ./
RUN npm ci RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
COPY . . COPY . .
RUN npm run build RUN npm run build
@@ -15,8 +15,8 @@ WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
ENV PORT=3000 ENV PORT=3000
COPY package.json package-lock.json ./ COPY package*.json ./
RUN npm ci --omit=dev && npm cache clean --force RUN if [ -f package-lock.json ]; then npm ci --omit=dev; else npm install --omit=dev; fi && npm cache clean --force
COPY --from=builder /app/dist ./dist COPY --from=builder /app/dist ./dist

View File

@@ -2,9 +2,5 @@ import { AppService } from './app.service';
export declare class AppController { export declare class AppController {
private readonly appService; private readonly appService;
constructor(appService: AppService); constructor(appService: AppService);
getHealth(): { getHealth(): string;
status: string;
service: string;
timestamp: string;
};
} }

View File

@@ -25,6 +25,7 @@ let AppController = class AppController {
exports.AppController = AppController; exports.AppController = AppController;
__decorate([ __decorate([
(0, common_1.Get)('health'), (0, common_1.Get)('health'),
(0, common_1.Header)('Content-Type', 'text/plain; charset=utf-8'),
__metadata("design:type", Function), __metadata("design:type", Function),
__metadata("design:paramtypes", []), __metadata("design:paramtypes", []),
__metadata("design:returntype", void 0) __metadata("design:returntype", void 0)

View File

@@ -1 +1 @@
{"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiD;AACjD,6CAA0C;AAC1C,+CAA2C;AAIpC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACK;IAA7B,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAGvD,SAAS;QACP,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;IACrC,CAAC;CACF,CAAA;AAPY,sCAAa;AAIxB;IADC,IAAA,YAAG,EAAC,QAAQ,CAAC;;;;8CAGb;wBANU,aAAa;IAFzB,IAAA,iBAAO,EAAC,QAAQ,CAAC;IACjB,IAAA,mBAAU,GAAE;qCAE8B,wBAAU;GADxC,aAAa,CAOzB"} {"version":3,"file":"app.controller.js","sourceRoot":"","sources":["../src/app.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyD;AACzD,6CAA0C;AAC1C,+CAA2C;AAIpC,IAAM,aAAa,GAAnB,MAAM,aAAa;IACK;IAA7B,YAA6B,UAAsB;QAAtB,eAAU,GAAV,UAAU,CAAY;IAAG,CAAC;IAIvD,SAAS;QACP,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;IACrC,CAAC;CACF,CAAA;AARY,sCAAa;AAKxB;IAFC,IAAA,YAAG,EAAC,QAAQ,CAAC;IACb,IAAA,eAAM,EAAC,cAAc,EAAE,2BAA2B,CAAC;;;;8CAGnD;wBAPU,aAAa;IAFzB,IAAA,iBAAO,EAAC,QAAQ,CAAC;IACjB,IAAA,mBAAU,GAAE;qCAE8B,wBAAU;GADxC,aAAa,CAQzB"}

View File

@@ -1,7 +1,3 @@
export declare class AppService { export declare class AppService {
getHealth(): { getHealth(): string;
status: string;
service: string;
timestamp: string;
};
} }

6
dist/app.service.js vendored
View File

@@ -10,11 +10,7 @@ exports.AppService = void 0;
const common_1 = require("@nestjs/common"); const common_1 = require("@nestjs/common");
let AppService = class AppService { let AppService = class AppService {
getHealth() { getHealth() {
return { return 'OK';
status: 'ok',
service: 'parsshop-back',
timestamp: new Date().toISOString(),
};
} }
}; };
exports.AppService = AppService; exports.AppService = AppService;

View File

@@ -1 +1 @@
{"version":3,"file":"app.service.js","sourceRoot":"","sources":["../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,SAAS;QACP,OAAO;YACL,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,eAAe;YACxB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CAAC;IACJ,CAAC;CACF,CAAA;AARY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;GACA,UAAU,CAQtB"} {"version":3,"file":"app.service.js","sourceRoot":"","sources":["../src/app.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAGrC,IAAM,UAAU,GAAhB,MAAM,UAAU;IACrB,SAAS;QACP,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAJY,gCAAU;qBAAV,UAAU;IADtB,IAAA,mBAAU,GAAE;GACA,UAAU,CAItB"}

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
import { Controller, Get } from '@nestjs/common'; import { Controller, Get, Header } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger'; import { ApiTags } from '@nestjs/swagger';
import { AppService } from './app.service'; import { AppService } from './app.service';
@@ -8,6 +8,7 @@ export class AppController {
constructor(private readonly appService: AppService) {} constructor(private readonly appService: AppService) {}
@Get('health') @Get('health')
@Header('Content-Type', 'text/plain; charset=utf-8')
getHealth() { getHealth() {
return this.appService.getHealth(); return this.appService.getHealth();
} }

View File

@@ -3,10 +3,6 @@ import { Injectable } from '@nestjs/common';
@Injectable() @Injectable()
export class AppService { export class AppService {
getHealth() { getHealth() {
return { return 'OK';
status: 'ok',
service: 'parsshop-back',
timestamp: new Date().toISOString(),
};
} }
} }