Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Cloud Slide P3 - Deploy Application & DataBase

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Cloud Slide P3 - Deploy Application & DataBase

Avatar for Panyakorn Timchantheuck

Panyakorn Timchantheuck

September 17, 2025
Tweet

More Decks by Panyakorn Timchantheuck

Other Decks in Technology

Transcript

  1. 04 Define MongoDB port 1. Define Hosts name (private ip)

    2. Presented by 9old VMs Architecture
  2. 05 Need to do this! Presented by 9old Create VPC

    Network 1. Create EC2 Instances 4. Create Subnetwork 2. Create Firewall 3. Create IGW 5. Create NAT 6. Create Routing Table 7. Deploy Application 8.
  3. “my-chatapp-vpc” Subnet name: public-subnet 07 Create Subnetwork Presented by 9old

    IPv4 subnet: 10.0.1.0/24 Public Subnet Zone: ap-southeast-1a
  4. 10 Presented by 9old Inbound Rules & Outbound Rules 80

    (http) 1. 8081 (Mongo Express) 2. 22 (SSH) 3.
  5. 12 Presented by 9old Inbound Rules & Outbound Rules 27017

    (MongoDB) 1. 22 (SSH) 2. Only “public-subnet” can access
  6. 14 Presented by 9old Select Instance type 3. Network setting

    4. VPC: my-chatapp-vpc Firewall: public-subnet-sg
  7. 19 Presented by 9old Create IGW (Internet Gateway) Create IGW

    1. Select Attach to VPC 2. Attach to VPC 3. "my-chatapp-vpc"
  8. 20 Presented by 9old Create Route Table of IGW Create

    Route Table 1. Add route path to IGW 2. Attach to public-subnet 3. "my-chatapp-igw" public-subnet
  9. 21 Presented by 9old Create NAT (NAT Gateway) Click Allocate

    Elastic IP Create NAT in public-subnet
  10. "my-chatapp-nat" 22 Presented by 9old Create Route Table of NAT

    Create Route Table 1. Add route path to IGW 2. Attach to private-subnet 3. private-subnet
  11. 23 Presented by 9old VPC Resource Map public-subnet ⟶ Route

    to IGW ⟶ Internet Gateway private-subnet ⟶ Route to NAT ⟶ Nat Gateway
  12. 24 Presented by 9old Deploy (db-vm) Git Clone 1. git

    clone --branch p3 --single-branch --no-checkout https://github.com/modpanyakorn/class-cloud-computing.git \ && cd class-cloud-computing \ && git sparse-checkout init --cone \ && git sparse-checkout set db \ && git checkout p3 Clone directory “/db” from branch “p3”
  13. Presented by 9old 25 Install Docker 2. Install Docker in

    Ubuntu from: docs.docker.com/engine/install/ubuntu Deploy Container 3. Deploy MongoDB Container $ docker compose up -d
  14. 26 Presented by 9old Deploy Application (app-vm) Test DB Connection

    1. $ curl db-vm-private-ip:27017 Test MongoDB connection from app-vm to db-vm Git Clone 2. Clone directory “/application” from branch “p3”
  15. 27 Presented by 9old Define Private IP 3. docker-compose.yml and

    .env $ nano docker-compose.yml $ nano server/.env
  16. Presented by 9old 28 Deploy Container 5. Deploy Application Containers

    $ docker compose up -d Install Docker 4. Install Docker in Ubuntu from: docs.docker.com/engine/install/ubuntu
  17. 31 Presented by 9old 😊 Dev: “ก็แค่เปิด EC2 เครื่องเดียวพอ” 😎

    Cloud Engineer: “งั้นผมขอทำ VPC, Subnet, NAT Gateway, Route Table, SG, IAM Role, Auto Scaling Group, CloudWatch, ALB, WAF...” 😑 Dev: ....... THANK YOU