LoginSignup
5
4

More than 5 years have passed since last update.

Cloud Foundry(Bluemix)を使ってmarkdown編集の出来るblogのghostを無料で使う

Last updated at Posted at 2015-09-19

はじめに

日本Cloud Foundryグループでは現在Cloud Foundry(PaaS)上でアプリをデプロイする為の知見を100個のアプリケーションで100日に渡って公開するCloud Foundry百日行という企画を実施しています

その中で公開されたGhostはMarkdownで編集することが可能なシンプルなblogアプリケーションです。

Ghost自体は無料でソースコードを入手する事が出来ますが、ホスティングサービスを利用する場合は料金ページを見ると8$/月ほど必要となるので、
無料で試す方法として、Bluemix上でデプロイする方法を紹介したいと思います。
※bluemixでは利用者毎に一定のサイズのアプリケーションまでは無料で利用可能です。

今回はCloud Foundry百日行のghostの記事の中で使われているCloud Foundry向けに修正されたコードを元に作成した版のソースを利用して説明をします。
※最新版を利用したい場合は百日行の手順をベースに自分で編集する事をオススメします。

事前準備

  1. bluemixのアカウントを入手 bluemixのアカウントがない場合は『KenichiSekineさんのQiita記事 IBM Bluemixフリートライアルアカウント作成手順』を参照して作成してください。
  2. cfコマンドを準備 Cloud Foundryの公式cliの最新のリリースから自分のOSに応じたファイルを入手します。

アプリケーションのデプロイとサービスの紐付け

ghostのソースを準備する

$ git clone https://github.com/morikat/ghost.git
$ cd ghost
$ git checkout fix-service-environment-spec

cfコマンドでbluemixのapiにログイン

下記のコマンドを入力するとEmailとPasswordを聞かれるので登録した値を入力します。
bash
$ cf login -a https://api.ng.bluemix.net

アプリをpaas上にpushする

※ここではサービスと紐付ける為に--no-startでpushします。また、cf-hostの部分がアプリ名でbluemix内でユニークで有る必要がある為、この手順を試す場合は別の名称でpushします。

$ cf push cf-ghost -m 256m --no-start

msyqlを作成する

※cf-ghost-mysql部分はpushしたアプリ名に-mysqlをつけると分かりやすいです。
bash
$ cf create-service mysql 100 cf-ghost-mysql
...
OK

アプリとmysqlを紐付ける

$ cf bind-service cf-ghost cf-ghost-mysql

アプリを起動

$ cf start cf-ghost
OK

App cf-ghost was started using this command `./vendor/initial_startup.rb`

Showing health and status for app cf-ghost in org morika-t@hotmail.co.jp / space dev as morika-t@hotmail.co.jp...
OK

requested state: started
instances: 1/1
usage: 256M x 1 instances
urls: cf-ghost.mybluemix.net
package uploaded: Sat Sep 19 12:17:52 UTC 2015

     state     since                    cpu    memory       disk           details
#0   running   2015-09-19 09:19:20 PM   0.0%   203M of 256M   193.2M of 1G

アプリにアクセス

※アプリ名がcf-ghostの場合は https://cf-ghost.mybluemix.net となります

image

管理画面にアクセス

※アプリ名がcf-ghostの場合は https://cf-ghost.mybluemix.net/ghost/setup/ となります。

CREATE YOUR ACCOUNTからアカウントを作成する事で記事を編集可能になります。
image

サンプル

今回のQiitaの記事をそのままghostにmarkdownを貼り付けて記事を書いてみました
※サンプルで上げている為、後ほど上記のURLはアクセス不可になるかも知れません

image

5
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
4