82 lines
2.0 KiB
Markdown
82 lines
2.0 KiB
Markdown
|
+++
|
||
|
date = "2018-09-03"
|
||
|
tags = ["cachet"]
|
||
|
title = "bluemixでcachetというstatus pageを立ててみた"
|
||
|
slug = "cachet"
|
||
|
+++
|
||
|
|
||
|
[CachetHQ/Cachet](https://github.com/CachetHQ/Cachet)
|
||
|
|
||
|
openshiftで作ったことあったのですが、動かなくなったので、今度は、bluemix(ibm cloud)のほうで試してみました。
|
||
|
|
||
|
```sh
|
||
|
$ git clone https://github.com/CachetHQ/Cachet
|
||
|
$ cd Cachet
|
||
|
$ git checkout v2.4
|
||
|
|
||
|
$ cat manifest.yml
|
||
|
applications:
|
||
|
- path: .
|
||
|
name: APP_NAME
|
||
|
memory: 256M
|
||
|
buildpack: https://github.com/cloudfoundry/php-buildpack
|
||
|
command: null
|
||
|
routes:
|
||
|
- route: APP_NAME.mybluemix.net
|
||
|
|
||
|
$ cat .bc-config/options.json
|
||
|
{
|
||
|
"COMPOSER_INSTALL_OPTIONS_DEBUG": [ "--no-dev", "-o"],
|
||
|
"PHP_VERSION": "{PHP_71_LATEST}",
|
||
|
"COMPOSER_VENDOR_DIR": "vendor",
|
||
|
"WEBDIR": "public",
|
||
|
"PHP_EXTENSIONS": ["bz2", "pdo", "zlib", "curl", "mcrypt", "mbstring", "mysqli", "gd", "zip", "pdo_mysql", "pdo_sqlite","iconv", "openssl" ]
|
||
|
}
|
||
|
|
||
|
$ cp .env.example .env
|
||
|
|
||
|
# mysqlはherokuのdbを使わせてもらうことに。bluemixでは、free(lite)で使えるdbがdb2(dashDB)とかしかないので、cachet(db:mysql)に対応していない
|
||
|
$ heroku create $APP_NAME
|
||
|
$ heroku addons:add cleardb -a $APP_NAME
|
||
|
$ heroku config -a $APP_NAME
|
||
|
mysql://${DB_USERNAME}:${DB_PASSWORD}@{DB_HOST}/${DB_DATABASE}
|
||
|
|
||
|
# url, mysqlのuriを入れていく
|
||
|
$ vim .env
|
||
|
APP_URL=https://APP_NAME.mybluemix.net
|
||
|
DB_DRIVER=mysql
|
||
|
DB_PREFIX=null
|
||
|
DB_HOST=
|
||
|
DB_DATABASE=
|
||
|
DB_USERNAME=
|
||
|
DB_PASSWORD=
|
||
|
DB_PORT=3306
|
||
|
|
||
|
# vim .env
|
||
|
CACHE_DRIVER=file
|
||
|
SESSION_DRIVER=file
|
||
|
QUEUE_DRIVER=sync
|
||
|
|
||
|
# 初期設定
|
||
|
$ composer install --no-dev -o
|
||
|
$ php artisan key:generate
|
||
|
|
||
|
# bluemixにdeployする
|
||
|
$ git add .
|
||
|
$ git commit -m "support bluemix"
|
||
|
$ bx cf push $APP_NAME
|
||
|
|
||
|
# logを確認
|
||
|
bx cf logs cachet --recent
|
||
|
|
||
|
# sshしてlogを確認
|
||
|
$ bx cf ssh $APP_NAME
|
||
|
$ cat app/storage/logs/l*
|
||
|
```
|
||
|
|
||
|
bluemixのライトプランは制限が結構きついです。使えるdb(db2)からmemory:256Mやinstans:1、そして、custom-domain:falseなど。
|
||
|
|
||
|
|
||
|
<span class="green"></span> [https://cachet.mybluemix.net](https://cachet.mybluemix.net)
|
||
|
|