init: dc-down dc-pull dc-build dc-up php-init

dc-up:
	docker-compose up -d

dc-down:
	docker-compose down --remove-orphans

dc-down-clear:
	docker-compose down -v --remove-orphans

dc-pull:
	docker-compose pull

dc-build:
	docker-compose build --pull

dc-restart:
	docker-compose restart

php-init: php-composer-install

php-composer-install:
	docker-compose run --rm php-cli composer install
	docker-compose run --rm php-cli php yii migrate --interactive=0

yii-init:
	mkdir frontend/runtime ; chmod 777 frontend/runtime
	mkdir frontend/runtime/cache ; chmod 777 frontend/runtime/cache
	mkdir frontend/runtime/debug ; chmod 777 frontend/runtime/debug
	mkdir frontend/runtime/logs ; chmod 777 frontend/runtime/logs
	mkdir frontend/web/assets ; chmod 777 frontend/web/assets
	mkdir backend/runtime ; chmod 777 backend/runtime
	mkdir backend/runtime/cache ; chmod 777 backend/runtime/cache
	mkdir backend/runtime/debug ; chmod 777 backend/runtime/debug
	mkdir backend/runtime/logs ; chmod 777 backend/runtime/logs
	mkdir backend/web/assets ; chmod 777 backend/web/assets
	mkdir control/runtime ; chmod 777 control/runtime
	mkdir control/runtime/cache ; chmod 777 control/runtime/cache
	mkdir control/runtime/debug ; chmod 777 control/runtime/debug
	mkdir control/runtime/logs ; chmod 777 control/runtime/logs
	mkdir control/web/assets ; chmod 777 control/web/assets
	mkdir operator/runtime ; chmod 777 operator/runtime
	mkdir operator/runtime/cache ; chmod 777 operator/runtime/cache
	mkdir operator/runtime/debug ; chmod 777 operator/runtime/debug
	mkdir operator/runtime/logs ; chmod 777 operator/runtime/logs
	mkdir operator/web/assets ; chmod 777 operator/web/assets