mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Обновлена версия базового php контейнера
Реструктуризация конфигурации app сервиса Добавлена cron задача для очистки устаревших access_token'ов
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
FROM registry.ely.by/elyby/accounts-php:1.0.0
|
FROM registry.ely.by/elyby/accounts-php:1.1.0
|
||||||
|
|
||||||
|
# Вносим конфигурации для крона и воркеров
|
||||||
|
COPY docker/cron/* /etc/cron.d/
|
||||||
|
COPY docker/supervisor/* /etc/supervisor/conf.d/
|
||||||
|
|
||||||
COPY id_rsa /root/.ssh/id_rsa
|
COPY id_rsa /root/.ssh/id_rsa
|
||||||
|
|
||||||
|
@@ -1,4 +1,8 @@
|
|||||||
FROM registry.ely.by/elyby/accounts-php:1.0.0-dev
|
FROM registry.ely.by/elyby/accounts-php:1.1.0-dev
|
||||||
|
|
||||||
|
# Вносим конфигурации для крона и воркеров
|
||||||
|
COPY docker/cron/* /etc/cron.d/
|
||||||
|
COPY docker/supervisor/* /etc/supervisor/conf.d/
|
||||||
|
|
||||||
COPY id_rsa /root/.ssh/id_rsa
|
COPY id_rsa /root/.ssh/id_rsa
|
||||||
|
|
||||||
|
2
docker/cron/cleanup
Normal file
2
docker/cron/cleanup
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# https://crontab.guru/every-hour
|
||||||
|
0 * * * * php /var/www/html/yii cleanup/access-tokens >/dev/null 2>&1
|
@@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [ -n "$API_TOKEN" ]
|
|
||||||
then
|
|
||||||
php /usr/local/bin/composer.phar config -g github-oauth.github.com $API_TOKEN
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec php /usr/local/bin/composer.phar "$@"
|
|
@@ -1,38 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
cd /var/www/html
|
|
||||||
|
|
||||||
if [ "$1" = "bash" ] || [ "$1" = "composer" ]
|
|
||||||
then
|
|
||||||
exec "$@"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Переносим vendor, если его нету или он изменился (или затёрся силами volume)
|
|
||||||
if ! cmp -s ./../vendor/autoload.php ./vendor/autoload.php
|
|
||||||
then
|
|
||||||
echo "vendor have diffs..."
|
|
||||||
echo "removing exists vendor"
|
|
||||||
rm -rf ./vendor
|
|
||||||
echo "copying new one"
|
|
||||||
cp -r ./../vendor ./vendor
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Переносим dist, если его нету или он изменился (или затёрся силами volume)
|
|
||||||
if ! cmp -s ./../dist/index.html ./frontend/dist/index.html
|
|
||||||
then
|
|
||||||
echo "frontend dist have diffs..."
|
|
||||||
echo "removing exists dist"
|
|
||||||
rm -rf ./frontend/dist
|
|
||||||
echo "copying new one"
|
|
||||||
cp -r ./../dist ./frontend/dist
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$YII_ENV" != "test" ]
|
|
||||||
then
|
|
||||||
wait-for-it db:3306 -s -- "php /var/www/html/yii migrate/up --interactive=0"
|
|
||||||
else
|
|
||||||
wait-for-it testdb:3306 -s -- "php /var/www/html/tests/codeception/bin/yii migrate/up --interactive=0"
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec "$@"
|
|
@@ -1,2 +0,0 @@
|
|||||||
error_reporting = E_ALL;
|
|
||||||
display_errors = On;
|
|
@@ -1,36 +0,0 @@
|
|||||||
[supervisord]
|
|
||||||
logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log)
|
|
||||||
logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB)
|
|
||||||
logfile_backups=10 ; (num of main logfile rotation backups;default 10)
|
|
||||||
loglevel=info ; (log level;default info; others: debug,warn,trace)
|
|
||||||
pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
|
|
||||||
nodaemon=false ; (start in foreground if true;default false)
|
|
||||||
minfds=1024 ; (min. avail startup file descriptors;default 1024)
|
|
||||||
minprocs=200 ; (min. avail process descriptors;default 200)
|
|
||||||
user=root
|
|
||||||
|
|
||||||
; the below section must remain in the config file for RPC
|
|
||||||
; (supervisorctl/web interface) to work, additional interfaces may be
|
|
||||||
; added by defining them in separate rpcinterface: sections
|
|
||||||
[rpcinterface:supervisor]
|
|
||||||
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
|
||||||
|
|
||||||
[supervisorctl]
|
|
||||||
serverurl=unix:///dev/shm/supervisor.sock ; use a unix:// URL for a unix socket
|
|
||||||
|
|
||||||
[program:php-fpm]
|
|
||||||
command=php-fpm
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
priority=5
|
|
||||||
stdout_logfile=/dev/stdout
|
|
||||||
stdout_logfile_maxbytes=0
|
|
||||||
stderr_logfile=/dev/stderr
|
|
||||||
stderr_logfile_maxbytes=0
|
|
||||||
|
|
||||||
[program:account-queue-worker]
|
|
||||||
directory=/var/www/html
|
|
||||||
command=wait-for-it rabbitmq:5672 -- php yii account-queue
|
|
||||||
autostart=true
|
|
||||||
autorestart=true
|
|
||||||
priority=10
|
|
6
docker/supervisor/account-queue-worker.conf
Normal file
6
docker/supervisor/account-queue-worker.conf
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[program:account-queue-worker]
|
||||||
|
directory=/var/www/html
|
||||||
|
command=wait-for-it rabbitmq:5672 -- php yii account-queue
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
priority=10
|
Reference in New Issue
Block a user