/simple-django-app

Trying to deploy (I mean, really deploy) a Django app

Primary LanguagePython

Simple Django App

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

Enter the instance

ssh -i KEY.pem ec2-user@ec2-54-210-82-193.compute-1.amazonaws.com

Docker the shit out of this

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

Build the docker image

docker build -t simple_django_app .

Run the docker image

sudo docker run -p 8000:8000 -i -t simple_django_app

References

Accessing Linux Instances

AWS Docker Basics

Docker + Django

DOcker + Django