orino-gif / illustlife

0 stars 0 forks source link

本番環境用にデプロイ&環境構築 #5

Closed orino-gif closed 3 years ago

orino-gif commented 3 years ago

EC2リザーブドインスタンスを本番用に利用

orino-gif commented 3 years ago

AWS IAMユーザーで料金表が見られるように設定

orino-gif commented 3 years ago

メモリー不足を発見。インスタンスタイプをt3.largeに変更。メモリー2GB→4GB。

orino-gif commented 3 years ago

アセットのファイルが見当たらない事が原因で、ブラウザ上に以下のエラーが出力される。 スクリーンショット 2021-07-15 174847

production環境で、/illustlife/config/environments/production.rbの config.assets.compile がfalseに設定されていた。

以下のコマンドで事前にアセットをコンパイル。 bundle exec rake assets:precompile RAILS_ENV=production

orino-gif commented 3 years ago

ブラウザ上でCSSの設定が反映されない

スクリーンショット 2021-07-16 091858

orino-gif commented 3 years ago

本番用でメール認証の送信が不能。アカウント登録直後のページ遷移後にエラー発生。

orino-gif commented 3 years ago

config.action_mailer.default_url_options = { host: 'defomate.com'} ↓ config.action_mailer.default_url_options = { host: 'defomate.net', port:3000}

にすると認証可能。

orino-gif commented 3 years ago

メール認証先のリンク先をみると、httpでアクセスしています。

http://defomate.net:3000/users/confirmation?confirmation_token=nweirxsxdfzjsk3XwN38

本番環境では、httpsでアクセスできるように設定しているので、 その辺りが少なくとも原因の一つと考えられます。

メール認証のリンク先をhttpsに変更する方法をご教示ください。

orino-gif commented 3 years ago

メール認証のリンク先をhttpからhttpsに変更 config.action_mailer.default_url_options = { host: 'defomate.com'} ↓ config.action_mailer.default_url_options = { :host => 'defomate.com', :protocol => 'https' }

orino-gif commented 3 years ago

動作確認済み。