Trying to deploy (I mean, really deploy) a Django app to an EC2 instance using ECS
Note: I did it! Rejoice with this beauty!
Note: I shutted down the instance, so.... do not rejoice </3
ssh -i KEY.pem ec2-user@ec2-54-210-82-193.compute-1.amazonaws.com
Create a source bundle to transfer the project to the EC2 instance
Generate the source bundle:
git archive -v -o simple_django_app.zip --format=zip HEAD
Upload the source bundle to the instance:
scp -i KEY.pem simple_django_app.zip ec2-user@ec2-54-210-82-193.compute-1.amazonaws.com:~
Then unzip the simple_django_app.zip file, and remove it from the server:
unzip simple_django_app.zip
rm simple_django_app.zip
docker build -t simple_django_app .
sudo docker run -p 8000:8000 -i -t simple_django_app