mirror of
https://github.com/flibusta-apps/book_bot.git
synced 2025-12-06 15:35:35 +01:00
Optimize docker image build
This commit is contained in:
@@ -6,7 +6,7 @@ COPY ./package.json ./
|
||||
COPY ./tsconfig.json ./
|
||||
COPY ./src ./src
|
||||
|
||||
RUN npm i && npm run build
|
||||
RUN yarn install --production && yarn build
|
||||
|
||||
|
||||
FROM node:lts-alpine as runtime-image
|
||||
@@ -16,8 +16,6 @@ WORKDIR /root/app
|
||||
COPY ./package.json ./
|
||||
COPY ./scripts/healthcheck.js ./
|
||||
|
||||
RUN npm i --only=production
|
||||
|
||||
COPY --from=build-image /root/app/build ./build
|
||||
|
||||
CMD npm run run
|
||||
CMD yarn run run
|
||||
|
||||
@@ -23,15 +23,15 @@
|
||||
"js-base64": "^3.7.2",
|
||||
"moment": "^2.29.1",
|
||||
"safe-compare": "^1.1.4",
|
||||
"telegraf": "^4.4.2"
|
||||
"telegraf": "^4.4.2",
|
||||
"esbuild": "^0.14.2",
|
||||
"typescript": "^4.5.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chunk-text": "^1.0.0",
|
||||
"@types/express": "^4.17.13",
|
||||
"@types/node": "^16.11.9",
|
||||
"@types/safe-compare": "^1.1.0",
|
||||
"esbuild": "^0.14.2",
|
||||
"nodemon": "^2.0.15",
|
||||
"typescript": "^4.5.2"
|
||||
"nodemon": "^2.0.15"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,6 +93,8 @@ export default class BotsManager {
|
||||
const webhookInfo = await bot.telegram.getWebhookInfo();
|
||||
const previousPendingUpdateCount = this.botsPendingUpdatesCount[state.id] || 0;
|
||||
|
||||
console.log(state.id, previousPendingUpdateCount, webhookInfo.pending_update_count);
|
||||
|
||||
if (previousPendingUpdateCount !== 0 && webhookInfo.pending_update_count !== 0) {
|
||||
this._setWebhook(bot, state);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user