もがき系プログラマの日常

もがき系エンジニアの勉強したこと、日常のこと、気になっている技術、備忘録などを紹介するブログです。

Blimp を試した

参考サイト

はじめに

こんばんは。

今回は参考サイトをみて、ワクワクしたので、 Blimpを試してみました。

Blimpって飛行船って意味なんですね。

だからロゴが飛行船なのか。

まぁそれはいいや。

本題

インストール

$ brew install kelda/tools/blimp
$ brew link blimp

blimpログイン

blimp loginを実行すると ブラウザでログインページが表示されるので、ログインすると Successfully loggedになります。

f:id:kojirooooocks:20201227225513p:plain

$ blimp login
Blimp will be shutting on Dec 15, 2020. Migrate to the self-hosted version (https://blimpup.io/docs/#/cluster-setup) to keep using it.
Your browser has been opened to log in.
Please leave this command running while you finish logging in.
If your browser doesn't open, you can also visit this link directly:


Successfully logged in

アプリケーション実行

アプリケーションは @ucan_labさんの docker-laravelを使わせてもらいました。

$ git clone git@github.com:ucan-lab/docker-laravel.git blimp-example
$ cd blimp-example
$ cp .env.example .env
$ composer create-project --prefer-dist "laravel/laravel=7.*" backend
$ cd backend
$ php artisan key:generate
$ cd ../
$ blimp up
.
..
...
Blimp will be shutting on Dec 15, 2020. Migrate to the self-hosted version (https://blimpup.io/docs/#/cluster-setup) to keep using it.
Booting cloud sandbox  
Deploying Docker Compose file to sandbox  
app     Running
db      Running
web     Running
All containers successfully started

確認

localhostにアクセスします。

f:id:kojirooooocks:20201227225528p:plain

キャッシュでエラーになるので、コンテナ内に入りstorageに権限を与えます。

$ blimp ssh app
$ chmod -R 777 storage

f:id:kojirooooocks:20201227225543p:plain

表示されました!

DBにもコンテナがあり、migrationsも実行できます。

$ php artisan migrate
Migration table created successfully.
Migrating: 2014_10_12_000000_create_users_table
Migrated:  2014_10_12_000000_create_users_table (0.09 seconds)
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated:  2014_10_12_100000_create_password_resets_table (0.07 seconds)
Migrating: 2019_08_19_000000_create_failed_jobs_table
Migrated:  2019_08_19_000000_create_failed_jobs_table (0.04 seconds)

終わりに

exposeとかで公開もできます。 ただ、security面はどうなんだろうとちょっと思ったりもします。

限定公開するという点では、最悪basic認証を自分で無理やりかけられる ngrok がまだ自分的に使いやすいかもしれません。

現場からは以上です。