Initial commit - Last War messaging system
This commit is contained in:
19
docker/Dockerfile
Executable file
19
docker/Dockerfile
Executable file
@@ -0,0 +1,19 @@
|
||||
FROM php:8.2-cli
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libcurl4-openssl-dev \
|
||||
libzip-dev \
|
||||
unzip \
|
||||
supervisor \
|
||||
nano \
|
||||
&& pecl install curl \
|
||||
&& docker-php-ext-enable curl \
|
||||
&& docker-php-ext-install pdo_mysql zip \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||
|
||||
WORKDIR /var/www/html
|
||||
|
||||
CMD ["/usr/bin/supervisord", "-c", "/var/www/html/docker/supervisord.conf"]
|
||||
47
docker/docker-compose.yml
Executable file
47
docker/docker-compose.yml
Executable file
@@ -0,0 +1,47 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
bot:
|
||||
image: php:8.2-cli
|
||||
container_name: lastwar_bot
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ../lastwar:/var/www/html/lastwar
|
||||
working_dir: /var/www/html/lastwar
|
||||
command: /usr/local/bin/supervisord -c /var/www/html/lastwar/docker/supervisord.conf
|
||||
environment:
|
||||
- PHP_DISPLAY_ERRORS=On
|
||||
- PHP_ERROR_REPORTING=E_ALL
|
||||
networks:
|
||||
- bot_network
|
||||
depends_on:
|
||||
- db
|
||||
|
||||
db:
|
||||
image: mysql:8.0
|
||||
container_name: lastwar_db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${DB_PASS:-}
|
||||
MYSQL_DATABASE: ${DB_NAME:-bot}
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
- ./db:/docker-entrypoint-initdb.d
|
||||
networks:
|
||||
- bot_network
|
||||
|
||||
libretranslate:
|
||||
image: libretranslate/libretranslate
|
||||
container_name: lastwar_libretranslate
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "5000:5000"
|
||||
networks:
|
||||
- bot_network
|
||||
|
||||
networks:
|
||||
bot_network:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
db_data:
|
||||
11
docker/supervisor_process_queue.conf
Executable file
11
docker/supervisor_process_queue.conf
Executable file
@@ -0,0 +1,11 @@
|
||||
[program:bot_process_queue]
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
command=php /var/www/html/lastwar/process_queue.php
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=www-data
|
||||
numprocs=1
|
||||
stdout_logfile=/var/www/html/lastwar/logs/process_queue.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stderr_logfile=/var/www/html/lastwar/logs/process_queue_error.log
|
||||
redirect_stderr=true
|
||||
11
docker/supervisor_translation_queue.conf
Executable file
11
docker/supervisor_translation_queue.conf
Executable file
@@ -0,0 +1,11 @@
|
||||
[program:bot_translation_queue]
|
||||
process_name=%(program_name)s_%(process_num)02d
|
||||
command=php /var/www/html/lastwar/process_translation_queue.php
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=www-data
|
||||
numprocs=1
|
||||
stdout_logfile=/var/www/html/lastwar/logs/translation_queue.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stderr_logfile=/var/www/html/lastwar/logs/translation_queue_error.log
|
||||
redirect_stderr=true
|
||||
46
docker/supervisord.conf
Executable file
46
docker/supervisord.conf
Executable file
@@ -0,0 +1,46 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=/var/www/html/lastwar/logs/supervisor.log
|
||||
logfile_maxbytes=50MB
|
||||
pidfile=/var/run/supervisord.pid
|
||||
childlogdir=/var/www/html/lastwar/logs
|
||||
|
||||
[program:bot_discord]
|
||||
process_name=%(program_name)s
|
||||
command=php /var/www/html/lastwar/discord_bot.php
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=www-data
|
||||
numprocs=1
|
||||
stdout_logfile=/var/www/html/lastwar/logs/discord_bot.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stderr_logfile=/var/www/html/lastwar/logs/discord_bot_error.log
|
||||
redirect_stderr=true
|
||||
|
||||
[program:bot_process_queue]
|
||||
process_name=%(program_name)s
|
||||
command=php /var/www/html/lastwar/process_queue.php
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=www-data
|
||||
numprocs=1
|
||||
stdout_logfile=/var/www/html/lastwar/logs/process_queue.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stderr_logfile=/var/www/html/lastwar/logs/process_queue_error.log
|
||||
redirect_stderr=true
|
||||
|
||||
[program:bot_translation_queue]
|
||||
process_name=%(program_name)s
|
||||
command=php /var/www/html/lastwar/process_translation_queue.php
|
||||
autostart=true
|
||||
autorestart=true
|
||||
user=www-data
|
||||
numprocs=1
|
||||
stdout_logfile=/var/www/html/lastwar/logs/translation_queue.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stderr_logfile=/var/www/html/lastwar/logs/translation_queue_error.log
|
||||
redirect_stderr=true
|
||||
|
||||
[group:bot_workers]
|
||||
programs=bot_discord,bot_process_queue,bot_translation_queue
|
||||
priority=999
|
||||
Reference in New Issue
Block a user