0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

ecsデプロイまで [コマンドまとめ自分用]

Posted at
リージョンをセット(東京)
AWS_REGION=ap-northeast-1
ECR中身を確認
aws ecr describe-repositories --region ${AWS_REGION}
ECRログイン
aws ecr get-login --region ${AWS_REGION} --no-include-email

==>>docker login -u以下すべてをコピーする.
===>>>login successed!

ECRの該当リポジトリ内のpush commandを表示通り

ECSクラスターで起動しているEC2インスタンスへ入る
ssh -i ~/.ssh/aws-and-infra-ssh-key.pem ec2-user@[EC2インスタンスのpublicIPかElasticIP]
EC2内で起動しているdockerコンテナを確認
docker ps
docker ps -a
docker ps -a を削除
docker ps -aq | xargs docker rm
起動コンテナに入る
docker exec -it [起動コンテナID] /bin/bash
データベース生成
rails db:create
rails db:migrate
rails db:migrate:reset
rails db:seed
データベース作成中のエラーに対して
DATABASE_ENVIRONMENT_CHECK=1
これが出たら

RAILS_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1 bundle exec rake db:drop
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?