Compare commits
2 Commits
7590316171
...
2243bb99e4
| Author | SHA1 | Date | |
|---|---|---|---|
| 2243bb99e4 | |||
| 1610dca929 |
@ -1,2 +0,0 @@
|
|||||||
TELEGRAM_BOT_TOKEN=8118888833:BBFr_C202uhbUS7PrjOLKjfeEA-Zq4LSMdA
|
|
||||||
TELEGRAM_BOT_WEBHOOK_URL=https://525e-7574-6204-49d7-6900-fc19-19db-d871-f583.ngrok-free.app
|
|
||||||
5
_deploy/dev/.env.example
Normal file
5
_deploy/dev/.env.example
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
COMPOSE_PROJECT_NAME=one_ton_daily_bot
|
||||||
|
|
||||||
|
BOT_PORT=2000
|
||||||
|
TELEGRAM_BOT_TOKEN=8118888833:BBFr_C202uhbUS7PrjOLKjfeEA-Zq4LSMdA
|
||||||
|
TELEGRAM_BOT_WEBHOOK_URL=https://a363-2a0b-6204-49d7-6900-f8fa-8992-d06f-46f2.ngrok-free.app
|
||||||
@ -1,18 +1,40 @@
|
|||||||
FROM node:21
|
FROM node:21
|
||||||
|
|
||||||
|
#ARG PORT
|
||||||
|
|
||||||
|
# Prevent Puppeteer from downloading Chromium
|
||||||
|
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
|
||||||
|
ENV PUPPETEER_EXECUTABLE_PATH="/usr/bin/chromium"
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
|
||||||
RUN apt-get update && apt-get install libsqlite3-dev sqlite3 -y
|
RUN apt-get update && apt-get install libsqlite3-dev sqlite3 -y
|
||||||
|
|
||||||
|
|
||||||
RUN ls -la /app/db
|
|
||||||
#RUN sleep 10
|
|
||||||
|
|
||||||
|
|
||||||
RUN npm install sqlite3 --save
|
|
||||||
RUN npm install --verbose
|
RUN npm install --verbose
|
||||||
|
|
||||||
CMD [ "npm", "run", "start:dev" ]
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
fonts-liberation \
|
||||||
|
libasound2 \
|
||||||
|
libatk-bridge2.0-0 \
|
||||||
|
libatk1.0-0 \
|
||||||
|
libcups2 \
|
||||||
|
libdrm2 \
|
||||||
|
libgbm1 \
|
||||||
|
libgtk-3-0 \
|
||||||
|
libnspr4 \
|
||||||
|
libnss3 \
|
||||||
|
libx11-xcb1 \
|
||||||
|
libxcomposite1 \
|
||||||
|
libxdamage1 \
|
||||||
|
libxrandr2 \
|
||||||
|
xdg-utils \
|
||||||
|
libu2f-udev \
|
||||||
|
libxshmfence1 \
|
||||||
|
libglu1-mesa \
|
||||||
|
chromium \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
CMD [ "npm", "run", "start:dev" ]
|
||||||
BIN
client/db/database.sqlite
Normal file → Executable file
BIN
client/db/database.sqlite
Normal file → Executable file
Binary file not shown.
52
client/package-lock.json
generated
52
client/package-lock.json
generated
@ -1622,6 +1622,20 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@nestjs/cli/node_modules/typescript": {
|
||||||
|
"version": "5.7.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz",
|
||||||
|
"integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.17"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@nestjs/common": {
|
"node_modules/@nestjs/common": {
|
||||||
"version": "10.4.15",
|
"version": "10.4.15",
|
||||||
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.15.tgz",
|
"resolved": "https://registry.npmjs.org/@nestjs/common/-/common-10.4.15.tgz",
|
||||||
@ -3125,9 +3139,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/bare-events": {
|
"node_modules/bare-events": {
|
||||||
"version": "2.5.2",
|
"version": "2.5.3",
|
||||||
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.2.tgz",
|
"resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.5.3.tgz",
|
||||||
"integrity": "sha512-KSdMqLj1ZERZMP1PTmnLK7SqJu9z9/SbwUUPZly2puMtfVcytC+jl6mb/9XYiqq0PXcx1rNDS+Qvl1g54Lho6A==",
|
"integrity": "sha512-pCO3aoRJ0MBiRMu8B7vUga0qL3L7gO1+SW7ku6qlSsMLwuhaawnuvZDyzJY/kyC63Un0XAB0OPUcfF1eTO/V+Q==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
@ -3306,9 +3320,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/browserslist": {
|
"node_modules/browserslist": {
|
||||||
"version": "4.24.3",
|
"version": "4.24.4",
|
||||||
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.3.tgz",
|
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.4.tgz",
|
||||||
"integrity": "sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA==",
|
"integrity": "sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -3632,9 +3646,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/caniuse-lite": {
|
"node_modules/caniuse-lite": {
|
||||||
"version": "1.0.30001690",
|
"version": "1.0.30001692",
|
||||||
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz",
|
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001692.tgz",
|
||||||
"integrity": "sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w==",
|
"integrity": "sha512-A95VKan0kdtrsnMubMKxEKUKImOPSuCpYgxSQBo036P5YYgVIcOYJEgt/txJWqObiRQeISNCfef9nvlQ0vbV7A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -4545,9 +4559,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/electron-to-chromium": {
|
"node_modules/electron-to-chromium": {
|
||||||
"version": "1.5.77",
|
"version": "1.5.79",
|
||||||
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.77.tgz",
|
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.79.tgz",
|
||||||
"integrity": "sha512-AnJSrt5JpRVgY6dgd5yccguLc5A7oMSF0Kt3fcW+Hp5WTuFbl5upeSFZbMZYy2o7jhmIhU8Ekrd82GhyXUqUUg==",
|
"integrity": "sha512-nYOxJNxQ9Om4EC88BE4pPoNI8xwSFf8pU/BAeOl4Hh/b/i6V4biTAzwV7pXi3ARKeoYO5JZKMIXTryXSVer5RA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
@ -11270,9 +11284,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
"node_modules/typescript": {
|
||||||
"version": "5.7.2",
|
"version": "5.7.3",
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
|
||||||
"integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==",
|
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
@ -11370,9 +11384,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/update-browserslist-db": {
|
"node_modules/update-browserslist-db": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz",
|
||||||
"integrity": "sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==",
|
"integrity": "sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -11391,7 +11405,7 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"escalade": "^3.2.0",
|
"escalade": "^3.2.0",
|
||||||
"picocolors": "^1.1.0"
|
"picocolors": "^1.1.1"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
"update-browserslist-db": "cli.js"
|
"update-browserslist-db": "cli.js"
|
||||||
|
|||||||
@ -8,11 +8,13 @@ import { ConfigModule } from '@nestjs/config';
|
|||||||
import { TypeOrmModule } from '@nestjs/typeorm';
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
|
console.log(path.resolve(__dirname, '../db/database.sqlite'));
|
||||||
|
|
||||||
@Module({
|
@Module({
|
||||||
imports: [
|
imports: [
|
||||||
ConfigModule.forRoot({
|
ConfigModule.forRoot({
|
||||||
isGlobal: true,
|
isGlobal: true,
|
||||||
envFilePath: './../_deploy/dev/.env',
|
envFilePath: '../../.env',
|
||||||
}),
|
}),
|
||||||
TelegrafModule.forRoot({
|
TelegrafModule.forRoot({
|
||||||
token: process.env.TELEGRAM_BOT_TOKEN,
|
token: process.env.TELEGRAM_BOT_TOKEN,
|
||||||
@ -25,7 +27,7 @@ import * as path from 'path';
|
|||||||
}),
|
}),
|
||||||
TypeOrmModule.forRoot({
|
TypeOrmModule.forRoot({
|
||||||
type: 'sqlite',
|
type: 'sqlite',
|
||||||
database: path.resolve(__dirname, '../../db/database.sqlite'),
|
database: path.resolve(__dirname, '../db/database.sqlite'),
|
||||||
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
entities: [__dirname + '/**/*.entity{.ts,.js}'],
|
||||||
synchronize: true,
|
synchronize: true,
|
||||||
}),
|
}),
|
||||||
@ -34,4 +36,4 @@ import * as path from 'path';
|
|||||||
controllers: [AppController],
|
controllers: [AppController],
|
||||||
providers: [AppService, BotUpdate],
|
providers: [AppService, BotUpdate],
|
||||||
})
|
})
|
||||||
export class AppModule {}
|
export class AppModule { }
|
||||||
46
docker-compose.yml
Normal file
46
docker-compose.yml
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
services:
|
||||||
|
bot:
|
||||||
|
build:
|
||||||
|
context: ./client
|
||||||
|
dockerfile: ./Dockerfile
|
||||||
|
|
||||||
|
environment:
|
||||||
|
- TZ=Europe/Moscow
|
||||||
|
- NODE_ENV=development
|
||||||
|
- PORT=${BOT_PORT}
|
||||||
|
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
|
||||||
|
- TELEGRAM_BOT_WEBHOOK_URL=${TELEGRAM_BOT_WEBHOOK_URL}
|
||||||
|
# ports:
|
||||||
|
# - '${BOT_PORT}:${BOT_PORT}'
|
||||||
|
networks:
|
||||||
|
- one_ton_daily_bot_network
|
||||||
|
volumes:
|
||||||
|
# - ./client/src:/app/src
|
||||||
|
- ./client/db:/app/db
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
# sqlitebrowser:
|
||||||
|
# image: linuxserver/sqlitebrowser
|
||||||
|
# ports:
|
||||||
|
# - "3000:3000"
|
||||||
|
# depends_on:
|
||||||
|
# - bot
|
||||||
|
# environment:
|
||||||
|
# - PUID=1000
|
||||||
|
# - PGID=1000
|
||||||
|
# - TZ=UTC
|
||||||
|
# - ENABLE_UWSGI=true
|
||||||
|
# volumes:
|
||||||
|
# - ../../db:/data/db
|
||||||
|
# networks:
|
||||||
|
# - one_ton_daily_bot_network
|
||||||
|
# restart: unless-stopped
|
||||||
|
# container_name: sqlitebrowser
|
||||||
|
|
||||||
|
|
||||||
|
networks:
|
||||||
|
one_ton_daily_bot_network:
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
db:
|
||||||
|
external: true
|
||||||
Loading…
Reference in New Issue
Block a user