a.k.a. shikorism.net
シコリズムネットにて提供している夜のライフログサービスです。 (思想的には shibafu528/SperMaster の後継となります)
[!WARNING] 2021年11月以前に環境を構築したことがある場合、データベースのバージョンアップ作業が必要です!
開発環境向けの移行手順 を参考にしてください。
Docker を用いた開発環境の構築方法です。
.env
ファイルを用意します。.env.example
をコピーすることで用意ができます。
Docker イメージをビルドします
docker compose build
docker compose up -d
docker compose exec web composer install
docker compose exec web php artisan key:generate
docker compose exec web php artisan migrate
docker compose exec web php artisan db:seed
docker compose exec web php artisan passport:install
コマンドを実行すると、次のようなメッセージが出力されます。この内容は控えておいてください。
Personal access client created successfully.
Here is your new client secret. This is the only time it will be shown so don't lose it!
Client ID: 1
Client secret: xxxxxxxx
Password grant client created successfully.
Here is your new client secret. This is the only time it will be shown so don't lose it!
Client ID: 2
Client secret: yyyyyyyy
.env
ファイルにPersonal access token発行用の設定を追加します。Personal access client created successfully
の直後に出力されている ID と secret を PASSPORT_PERSONAL_ACCESS_CLIENT_ID
と PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET
に設定します。PASSPORT_PERSONAL_ACCESS_CLIENT_ID=1
PASSPORT_PERSONAL_ACCESS_CLIENT_SECRET=xxxxxxxx
docker compose exec web chown -R www-data /var/www/html/storage
.env
を読み込み直すために起動し直します。docker compose up -d
これで準備は完了です。Tissue が動いていれば http://localhost:4545/
でアクセスができます。
docker compose -f compose.yaml -f compose.debug.yaml up -d
で起動することにより、DB のポート5432
を開放してホストマシンから接続できるようになります。
変更をしたらPull Requestを投げる前にテストが通ることを確認してください。
テストは以下のコマンドで実行できます。
docker compose exec web composer test