The Infrastructure projects on docker With just one command We can set up an environment with lots of containers with required technology
Get ready with the following stuff before diving into docker-compose.yml file.
-
Installing docker and docker-compose:
- Head to the link. It will guide you to download and install docker-compose.
-
Installing httpd
- Go to the following link to download and install httpd. You can configure
httpd.conf
file.
- Go to the following link to download and install httpd. You can configure
Go to the above given directories
cd <name of the directory>
Paste the given docker-compose.yml
file into the directory. In the Terminal, head to the directory and run:
docker-compose up -d
❗ Here -d
is an option to run docker in background. You can omit it if not required. ❗
-
For this, you need to install
mysql
andmariadb
software on the host o.s of docker.Note: mysql and mariadb are conflicting packages. You need to enter
--allowerasing
option to overcome the issue. -
Run the following and find the IP address of mariadb container:
docker inspect
CONTAINER ID of mariadb
-
Run the following to connect to the mariadb database remotely :
mysql -h
IP of mariadb
-uusername of mariadb
-ppassword of mariadb
-
If your mariadb is correctly working, you will be redirected to
mariadb shell
and you can run sql commands likeshow databases;
,show tables;
,exit;
etc.
In the terminal
docker ps
(in linux)
It shows the running containers
To get get the IP of each of the container running do
docker inspect $(docker ps -q) | grep IP
It gives the IP of all the containers currently running
Go to your web browser and in type
localhost:(port_number)
-I also uploaded them ,they just setup the environment.
- Lamp stack
- Lemp stack
-> Syed Faheemuddin
->Gmail: syedfaheemuddin456987@gmail.com
->Linked-in : https://www.linkedin.com/in/syed-faheem-96b677196/