Create a Common Network for PHP & MySQL container
- docker network create chatbot
PHP Container
- At first clone this repo https://github.com/shawon100/RUET-ChatBot
- Then go to the folder. Change the host name from localhost to db and add password 1test2 in config.php
- Build the image
- docker build -t chatbotimage .
- Finally Run the Image
- docker run -d -p 5400:80 --name chatbotapp --network chatbot chatbotimage
MySQL Container
Pull mysql image and then Run
docker pull mysql
docker run -d -p 3306:3306 --name db --network chatbot -e MYSQL_ROOT_PASSWORD=1test2 -e MYSQL_DATABASE=chat mysql
Exec into mysql container
docker exec -it db bash
Login to mysql and database
mysql -u root -p
use chat;
Run the sql commands from the database/chat.sql to create user &
insert data
Go to http://localhost:5400
Video tutorial
0 comments:
Post a Comment