I hope you read all previous blog & understood it well, Today lets create a Docker File with LAMP installation, Supervisor (to runservice automatically while starting up container) & Prestashop Framework installation in container as i mentioned in my previous blog.
Come on sysadmin when we have docker container then why should we install Apache2, Mysql, php, Prestashop in our base machine ?
Its time to virtualize our application environment.
To do this, we need to make a Docker file & after execution of that docker file we will build a container in which all of our required application installed.
If you dont want to make Docker File then you can directly download the container from the mentioned command below and get your container ready.
To download the container, you just need to execute:-
1 |
docker pull webkul/lamp-with-prestashop |
after execution this command, you will get a container named webkul/lamp-with-prestashop and make it in working by execute:-
1 |
docker run -i -p 80:80 -p 3306:3306 --name=give_any_name_you_want -d webkul/lamp-with-prestashop |
NOTE:- No other services should be running on port 80 and 3306 of your host system. If its running, change the ports in the above docker command & run.
then just go to ypur browser and hit the url:-
http://localhost/prestashop/
then you will be redirect to the installation page of Prestashop framework and then you will be asked some information like database name, database user name, database password, all info is mentioned below:-
1 2 3 |
DATABASE NAME = prestashop DATABASE USERNAME = admin DATABASE PASSWORD = admin |
You can also change the password of mysql.
IF you want to access your mysql database graphically then i have added adminer.php too.
To access your database graphically, just hit the url:
http://localhost/prestashop/adminer.php
Username & Password is same as, i mentioned.
Now your Prestashop Framework is ready.
Now lets have a look How i made Docker file to get Prestashop container ready.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
From ubuntu:14.04 MAINTAINER Prashant Arora <prashant089@webkul.com> RUN apt-get -y update RUN apt-get -y install lamp-server^ RUN mkdir -p /var/lock/apache2 /var/run/apache2 RUN apt-get install -y wget unzip vim nano gedit RUN apt-get install libapache2-mod-php5 php5-mcrypt php5-gd RUN php5enmod mcrypt RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf RUN apt-get install -y openssh-server RUN mkdir -p /var/run/sshd RUN apt-get install -y supervisor RUN mkdir -p /var/log/supervisor COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY mysql.sh /etc/mysql.sh RUN chmod +x /etc/mysql.sh COPY prestashop.zip /var/www/html/ RUN cd /var/www/html && unzip prestashop.zip RUN rm -rf /var/www/html/prestashop.zip RUN rm /var/www/html/index.html COPY adminer.php /var/www/html/prestashop/ RUN cd /var/www/html && chown -R www-data: prestashop EXPOSE 80 EXPOSE 22 EXPOSE 3306 CMD ["/usr/bin/supervisord"] |
For Reference :- https://hub.docker.com/r/webkul/lamp-with-prestashop/
For Source Code :- https://github.com/webkul/LAMP-WITH-PRESTASHOP