File tree Expand file tree Collapse file tree 9 files changed +69
-7
lines changed Expand file tree Collapse file tree 9 files changed +69
-7
lines changed Original file line number Diff line number Diff line change 1
- APP_URL =
1
+ APP_URL = http://nginx
2
2
3
+ DB_HOST = database
4
+ DB_DATABASE = php-telegram-bot
5
+ DB_USERNAME = php-telegram-bot
6
+ DB_PASSWORD = secret
7
+
8
+ # Token and Username from @BotFather
3
9
TELEGRAM_BOT_TOKEN =
4
10
TELEGRAM_BOT_USERNAME =
5
- TELEGRAM_BOT_API_SERVER =
11
+
12
+ # Optionally for testing with custom Bot API server
13
+ TELEGRAM_API_ID =
14
+ TELEGRAM_API_HASH =
15
+ TELEGRAM_BOT_API_SERVER = http://api-server:8081
Original file line number Diff line number Diff line change
1
+ version : ' 3'
2
+ services :
3
+ php :
4
+ build : docker/php
5
+ volumes :
6
+ - ./:/app
7
+
8
+ nginx :
9
+ image : nginx
10
+ volumes :
11
+ - ./docker/nginx/site.conf:/etc/nginx/conf.d/default.conf
12
+ - ./:/app
13
+
14
+ database :
15
+ image : mariadb
16
+ volumes :
17
+ - ./packages/php-telegram-bot/structure.sql:/docker-entrypoint-initdb.d/structure.sql
18
+ environment :
19
+ MYSQL_ALLOW_EMPTY_PASSWORD : yes
20
+ MYSQL_DATABASE : $DB_DATABASE
21
+ MYSQL_USER : $DB_USERNAME
22
+ MYSQL_PASSWORD : $DB_PASSWORD
23
+
24
+ api-server :
25
+ image : tdlight/tdlightbotapi
26
+ environment :
27
+ TELEGRAM_API_ID : $TELEGRAM_API_ID
28
+ TELEGRAM_API_HASH : $TELEGRAM_API_HASH
29
+ TELEGRAM_LOCAL : yes
Original file line number Diff line number Diff line change
1
+ server {
2
+ listen 80;
3
+ server_name localhost;
4
+ root /app;
5
+
6
+ location ~\.php$ {
7
+ try_files $uri =404;
8
+ fastcgi_pass php:9000;
9
+ include fastcgi_params;
10
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
11
+ }
12
+ }
Original file line number Diff line number Diff line change
1
+ FROM php:8.1-fpm
2
+
3
+ COPY --from=composer /usr/bin/composer /usr/bin/composer
4
+ COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
5
+
6
+ RUN set -eux; \
7
+ apt-get update; \
8
+ apt-get install -y git; \
9
+ install-php-extensions pdo_mysql zip
10
+
11
+ WORKDIR /app
Original file line number Diff line number Diff line change 2
2
3
3
use Longman \TelegramBot \Request ;
4
4
5
- require ' ../bootstrap.php ' ;
5
+ require __DIR__ . ' / ../bootstrap.php ' ;
6
6
7
7
$ telegram = createTelegram ();
8
8
Original file line number Diff line number Diff line change 2
2
3
3
use Longman \TelegramBot \Request ;
4
4
5
- require ' ../bootstrap.php ' ;
5
+ require __DIR__ . ' / ../bootstrap.php ' ;
6
6
7
7
$ telegram = createTelegram ();
8
8
Original file line number Diff line number Diff line change 2
2
3
3
use Longman \TelegramBot \Exception \TelegramException ;
4
4
5
- require ' ../bootstrap.php ' ;
5
+ require __DIR__ . ' / ../bootstrap.php ' ;
6
6
7
7
$ telegram = createTelegram ();
8
8
Original file line number Diff line number Diff line change 2
2
3
3
use Longman \TelegramBot \Request ;
4
4
5
- require ' ../bootstrap.php ' ;
5
+ require __DIR__ . ' / ../bootstrap.php ' ;
6
6
7
7
$ telegram = createTelegram ();
8
8
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- require ' ../bootstrap.php ' ;
3
+ require __DIR__ . ' / ../bootstrap.php ' ;
4
4
5
5
$ telegram = createTelegram ();
6
6
You can’t perform that action at this time.
0 commit comments