https://github.com/pratikshinde55/docker-three_tier-architecture
Three Tier Architecture using Docker
https://github.com/pratikshinde55/docker-three_tier-architecture
docker docker-container docker-image docker-network
Last synced: 4 months ago
JSON representation
Three Tier Architecture using Docker
- Host: GitHub
- URL: https://github.com/pratikshinde55/docker-three_tier-architecture
- Owner: Pratikshinde55
- Created: 2023-09-24T13:12:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-24T13:49:05.000Z (5 months ago)
- Last Synced: 2024-12-24T15:12:31.463Z (5 months ago)
- Topics: docker, docker-container, docker-image, docker-network
- Homepage:
- Size: 54.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Three Tier Architecture using Docker
Create Blogging Site using Docker manual method.- Set-up:
I use AWS EC2 Instance for this work. The EC2 Amazon machine is Amazon-linux.
- What is Three-tier Architecture:
1. For Blogging Site I use "WordPress".
2. For DataBase to the Wordpress I use "MySQL".
3. For Network I use own customised "Docker network".## Step: 1 [Install Docker & Start Docker Services]
Launch EC2 instance and install docker inside and start docker Service:Docker install command:
yum install docker -yStart Docker Service command:
systemctl enable docker --nowCheck Docker Status:
systemctl status docker
## Step: 2 [Create Custom Docker Network]
create own net name as "psnet"Subnet range 10.0.0.1/16 in CIDR format.
Command for check docker network list:
docker network lsDocker network create command:
docker network create --driver bridge --subnet 10.0.0.1/16 psnet
## Step: 3 [Launch MySQL Container using own Network]
Create database with own driver (database- container name)...also provide required enviromental variable
Launch MySQL container using custom networks & adding environmental variables & Attach Host folder:
docker run -dit --name database --network psnet -v /mydata:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=pratik55 -e MYSQL_DATABASE=mydatabase -e MYSQL_USER=jack -e MYSQL_PASSWORD=jack11 mysql
Inspect command for check:(here we see our Subnet range(10.0.0.1/16) to our given database container)
docker inspect database

Here, check provided Subnet range.
## Step: 4 [Launch Wordpress Container using own Newtwork]
Launch wordpress and uase PATTING to make outside world connection,As port number of container is 80.Command for check list port numbers on system:
netstat -tnlp
Lanuch Wordpress container using custom network:
docker run -dit --name mywordpress --network psnet -p 1234:80 wordpress
Can also check MYWORDPRESS has our subnet range by command on above screenshots.(step no.3)
docker inspect mywordpress## Step: 5 [Edit Inbound rule/ Firewall]
EC2 Intance has Firewall which cannot be connected by outside world, so we can modify Inbound rule(All traffic allowed)
Substeps:
1. EC2 Dashboard
2. Celect securtity option
3. Go inside Security groups
4. Select "edit inbound rule"
5. Delete defult rule and new rule
6. custom TCP ->> "ALL TRAFIC", ANYWHERE IPv4
7. Save rule## Step: 6 [Access Wordpress from Browser]
Instance public + our port number that provide in wordpress contanier.To access wordpresss from browser,need EC2 instance public IP Address+Port no. given to wordpresss container.

To get wordpress interface on google ,provide details that provided in the form of enviromental variable during "database" caintainer launch
http://65.2.146.158:1234 <<------- see interface(This site does not work as instance is terminated now)


## Step: 7 [Fill Info]
Create username and password to create blog on wordpress:

## Step: 8 [Create Blog page]
On Wordpress Dashboard->create Post->Add Content->Publish->Copy link and paste in the browser.


### This is Three Tier Architecture using Docker Overview:
1. WordPress-Blogging Site
2. MySQL-Database
3. PSNet-Own Bridge driver