Test CI/CD 3 & fix healthcheck
This commit is contained in:
@@ -2,8 +2,8 @@ FROM node:22-bookworm-slim AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
COPY package*.json ./
|
||||
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
||||
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
@@ -15,8 +15,8 @@ WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3000
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev && npm cache clean --force
|
||||
COPY package*.json ./
|
||||
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
|
||||
|
||||
|
||||
6
dist/app.controller.d.ts
vendored
6
dist/app.controller.d.ts
vendored
@@ -2,9 +2,5 @@ import { AppService } from './app.service';
|
||||
export declare class AppController {
|
||||
private readonly appService;
|
||||
constructor(appService: AppService);
|
||||
getHealth(): {
|
||||
status: string;
|
||||
service: string;
|
||||
timestamp: string;
|
||||
};
|
||||
getHealth(): string;
|
||||
}
|
||||
|
||||
1
dist/app.controller.js
vendored
1
dist/app.controller.js
vendored
@@ -25,6 +25,7 @@ let AppController = class AppController {
|
||||
exports.AppController = AppController;
|
||||
__decorate([
|
||||
(0, common_1.Get)('health'),
|
||||
(0, common_1.Header)('Content-Type', 'text/plain; charset=utf-8'),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", []),
|
||||
__metadata("design:returntype", void 0)
|
||||
|
||||
2
dist/app.controller.js.map
vendored
2
dist/app.controller.js.map
vendored
@@ -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"}
|
||||
6
dist/app.service.d.ts
vendored
6
dist/app.service.d.ts
vendored
@@ -1,7 +1,3 @@
|
||||
export declare class AppService {
|
||||
getHealth(): {
|
||||
status: string;
|
||||
service: string;
|
||||
timestamp: string;
|
||||
};
|
||||
getHealth(): string;
|
||||
}
|
||||
|
||||
6
dist/app.service.js
vendored
6
dist/app.service.js
vendored
@@ -10,11 +10,7 @@ exports.AppService = void 0;
|
||||
const common_1 = require("@nestjs/common");
|
||||
let AppService = class AppService {
|
||||
getHealth() {
|
||||
return {
|
||||
status: 'ok',
|
||||
service: 'parsshop-back',
|
||||
timestamp: new Date().toISOString(),
|
||||
};
|
||||
return 'OK';
|
||||
}
|
||||
};
|
||||
exports.AppService = AppService;
|
||||
|
||||
2
dist/app.service.js.map
vendored
2
dist/app.service.js.map
vendored
@@ -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"}
|
||||
2
dist/tsconfig.build.tsbuildinfo
vendored
2
dist/tsconfig.build.tsbuildinfo
vendored
File diff suppressed because one or more lines are too long
@@ -1,4 +1,4 @@
|
||||
import { Controller, Get } from '@nestjs/common';
|
||||
import { Controller, Get, Header } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { AppService } from './app.service';
|
||||
|
||||
@@ -8,6 +8,7 @@ export class AppController {
|
||||
constructor(private readonly appService: AppService) {}
|
||||
|
||||
@Get('health')
|
||||
@Header('Content-Type', 'text/plain; charset=utf-8')
|
||||
getHealth() {
|
||||
return this.appService.getHealth();
|
||||
}
|
||||
|
||||
@@ -3,10 +3,6 @@ import { Injectable } from '@nestjs/common';
|
||||
@Injectable()
|
||||
export class AppService {
|
||||
getHealth() {
|
||||
return {
|
||||
status: 'ok',
|
||||
service: 'parsshop-back',
|
||||
timestamp: new Date().toISOString(),
|
||||
};
|
||||
return 'OK';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user