Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
debugvelop authored Jul 10, 2020
1 parent 3e3f73d commit 1d58f3d
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# AWS Demo: Containerized Django + PostgreSQL
Let's say right now you want to try Django + Postgres. As time goes by, you want to reset it. Unconciously you had already installed so much that reinstall Django + Postgres will break something. One way to prevent this nightmare is by containerized Django + Postgres.
# AWS Demo: Containerized Django + AWS RDS PostgreSQL
Let's say right now you want to try Django. Then at some point in the future you want to reset it. Unconciously you had already installed so much that reinstall Django will break something. One way to prevent this nightmare is by containerizing Django and store it in a container registry for later use.

### Requirement
* AWS account (free tier is sufficient)

### Create Django + Postgres Docker Image in EC2
### Create Django Docker Image in EC2
1. Go to EC2 Management Console then launch an EC2 instance with this configuration:
* AMI: Ubuntu Server 20.04 LTS x86_64
* Type: t2.micro
Expand Down Expand Up @@ -44,9 +44,21 @@ sudo docker build -t demo .
sudo docker run demo -d -p 80:8000
```

### Upload Django + Postgres Docker Image to Container Registry
### Upload Django Docker Image to Container Registry
1. Go to IAM Console then add a new user for the instance with this configuration
* Access type: Programmatic Access
* Set permissions: Attach existing policies directly (AmazonEC2ContainerRegistryFullAccess)
2. Save Access key ID and Secret access key.
3.
2. Save **access key ID** and **secret access key**.
3. Back to the instance's SSH and install AWS CLI.
```
unzip awscliv2.zip
sudo ./aws/install -i /usr/local/aws-cli -b /usr/local/bin
```
4. Verify that AWS CLI is installed correctly.
```
aws --version
```
5. Connect AWS CLI to IAM User by entering previously saved **access key ID** and **secret access key**.
```
aws configure
```

0 comments on commit 1d58f3d

Please sign in to comment.