Photo by Domenico Loia on Unsplash
How to create a Beginner Docker Project?
This is my First Docker Project which I created to make an online portal with PostgreSQL as DBMS and Odoo as business management software.
DockerProject
This is my first project on Docker which I Integrated with PostgreSQL( RDMS) and Odoo(business management software )running both on different Docker O.S. to create an online portal to sell goods and services.
Description
This project is used to check one's Knowledge of docker and docker-compose. For Database management, I used PostgreSQL which is an open source and free Relational Database Management System. For setting up my Web application I used Odoo an open-source ERP and CRM. On Odoo I launched my Web app for the Online Product Delivery system with a Payment option also. This System of using Multiple O.S. tied together is termed Multi-tier architecture. With the use of Networking(PAT) and Persistent Storage (docker Volumes) helped in achieving this accomplishment and the rest is history.
Initial Configuration
Some Initial Changes must be made on your base O.S. so that a proper connection can be established.
FIREWALL
For this project, the firewall must be Disabled. This might affect your security on your O.S. so recommended doing so on a Virtual Machine.
Step 1:
systemctl stop firewalld
This step Disables the firewall but temporarily and might again come up when base O.S. is booted.
Step 2:
systemctl disable firewalld
This permanently disables the firewall.
IPTABLES
This must be done to allow all Packets in iptables for smooth flow of data.
Step 1:
iptables -F
To flush all the rules which were already setup.
Step 2:
iptables -nvL
To Check the validity of first command.
Step 3:
iptables -P FORWARD ACCEPT
To make changes in iptable and allow all traffic.
Step 4:
iptables -nvL
To Check the final results.
Prerequisites
- Docker CE must be installed on your BASE O.S. mine was RHEL 8 on Virtual box Oracle
- Docker Compose must also be Installed.Version 2 and above are recommended because some commands are not supported in the below versions.
Docker Compose
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration. For Installation site click here.
After installation Separate directory must be created on your base O.S. so management of files can be made easy . Directory can be created anywhere
mkdir /abhi
cd /abhi
Inside the directory following commands should be typed to create a yml file.
vim docker-compose.yml
Inside the vim editor Following Commands must be typed as it is.WARNING:Spacing should be done carefully using Spacebar and not TAB to avoid any errors .
LIGHT IT UP!:fire::fire:
Now After typing the commands SAVE THE FILE Write the below code in the command line in the same Directory.
docker-compose up
FINAL OUTCOME
You can check the validity of the above command if done right or not by using the following command in another window terminal.
docker ps
The above will show two containers up and running and also that port no. 8080 also have been diverted.
Now, find your systems IPADDRESS by using the below command
ifconfig
Under your network card name, your 32bit size IPADDRESS can be found. In this case, we have chosen PORT NUMBER :8080 default for access but it can be changed only prior to that it's free. The port has been diverted to :8069 because it's the default for Odoo and can also be changed.
Enter Your IPADDRESS followed by PORT NO. in your browser of any other computer but make sure both are connected to the same SWITCH(Router) only.
You may find this screen welcoming you.
Fill all your details, this is your Administrator's Account By clicking on create database next screen is following:
INSTALL THE E-COMMERCE TO SET UP YOUR PLATFORM
CHOOSE A THEME FOR YOUR WEBSITE
After I published some products(Imaginary:grin:) and edited my home page.
WELCOME TO MY HOMEPAGE
THE FOLLOWING ARE THE PRODUCTS I CREATED
SELECT AND ADD THEM TO YOUR CART
AFTER SELECTING YOU WILL BE REDIRECTED TO THE FOLLOWING PAGE
AFTER FILLING IN YOUR DETAILS YOU CAN MAKE THE PAYMENT BY WIRE (CAN ALSO BE MADE TO SUPPORT OTHER MODES OF PAYMENTS ALSO) AND YOU HAVE SUCCESSFULLY MADE THE PURCHASE
EVERY PROCESS IS AUTOMATED FROM PLACING A ORDER TO MAKING A PAYMENT SUPPORTED BY ODOO
Acknowledgement
THANK YOU FOR READING THIS AND FOR THE APPRECIATION, CONNECT ME ON LINKED FOR ANY PROJECT RELATED QUERY