mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Структура проекта окончательно загнана в Docker
Дегрейд PHP до 7.0 (всё таки без xdebug немного больно) Дегрейд Node.js до 5.12 (на 6.5 не собирался фронт) Упразднён app-console контейнер (он теперь живёт внутри основного php контейнера и рулится силами supervisor) Упразднён node-dev-server (всё равно он работал плохо) Фикс бага в ConfigLoader (не загружал config-{env} файлы) Исправлена ошибка в LangMenu (двойной default экспорт) Из package.json временно удалён PhantomJS Обновлён README.md
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
FROM nginx:1.11
|
||||
FROM nginx:1.11-alpine
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY account.ely.by.conf.template /etc/nginx/conf.d/account.ely.by.conf.template
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
#!/usr/bin/env sh
|
||||
|
||||
envsubst '$AUTHSERVER_HOST' < /etc/nginx/conf.d/account.ely.by.conf.template > /etc/nginx/conf.d/default.conf
|
||||
|
||||
|
33
docker/php/entrypoint.sh
Normal file
33
docker/php/entrypoint.sh
Normal file
@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
cd /var/www/html
|
||||
|
||||
if [ "$1" = 'bash' ]
|
||||
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
|
||||
|
||||
wait-for-it db:3306 -- "./yii migrate/up --interactive=0"
|
||||
|
||||
exec "$@"
|
36
docker/php/supervisord.conf
Normal file
36
docker/php/supervisord.conf
Normal file
@ -0,0 +1,36 @@
|
||||
[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
|
@ -1,8 +0,0 @@
|
||||
FROM rabbitmq:3.6
|
||||
|
||||
RUN rabbitmq-plugins enable rabbitmq_management \
|
||||
&& rabbitmq-plugins enable rabbitmq_web_stomp \
|
||||
&& rabbitmq-plugins enable rabbitmq_mqtt
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
CMD ["rabbitmq-server"]
|
Reference in New Issue
Block a user