add: dockerfile
* change polling behaviour to be dev only
This commit is contained in:
parent
441ca421ee
commit
e3b11fb719
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.nyc*
|
||||||
|
node_modules
|
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
FROM node:17-alpine
|
||||||
|
|
||||||
|
ENV NODE_ENV production
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci --only=production
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
CMD [ "node", "src/" ]
|
@ -1,4 +1,4 @@
|
|||||||
[server]
|
[server]
|
||||||
host=0.0.0.0
|
host=0.0.0.0
|
||||||
port=3030
|
port=80
|
||||||
endpoint=
|
endpoint=
|
@ -1,3 +1,2 @@
|
|||||||
[telegram]
|
[telegram]
|
||||||
polling=true
|
|
||||||
token=
|
token=
|
@ -6,7 +6,7 @@ const cache = require("./cache");
|
|||||||
const bot = require("./bot");
|
const bot = require("./bot");
|
||||||
const log = require("./log");
|
const log = require("./log");
|
||||||
|
|
||||||
if (config.get("TELEGRAM_POLLING")) {
|
if (process.env.NODE_ENV !== "production") {
|
||||||
bot.api.deleteWebhook().then(() => {
|
bot.api.deleteWebhook().then(() => {
|
||||||
log.info("starting bot in polling mode");
|
log.info("starting bot in polling mode");
|
||||||
bot.start();
|
bot.start();
|
||||||
|
Loading…
Reference in New Issue
Block a user