├── supervisord.conf ├── credentials.sh ├── Dockerfile └── README.md /supervisord.conf: -------------------------------------------------------------------------------- 1 | [supervisord] 2 | nodaemon=true 3 | 4 | [program:update_credentials] 5 | command=/bin/bash -c "/etc/credentials.sh" 6 | 7 | [program:mysql] 8 | command=service mysql start 9 | autostart = true 10 | autorestart = false 11 | stopasgroup=true 12 | 13 | [program:apache2] 14 | command=service apache2 start 15 | autostart = true 16 | autorestart = false 17 | stopasgroup=true 18 | 19 | [program:ssh] 20 | command=service ssh start 21 | autostart = true 22 | autorestart = false 23 | stopasgroup=true 24 | -------------------------------------------------------------------------------- /credentials.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -u 3 | ##set user password 4 | user=qloapps 5 | echo -e "$USER_PASSWORD\n$USER_PASSWORD" | passwd $user 6 | ##Check for database connectivity 7 | database_connectivity_check=no 8 | var=1 9 | while [ "$database_connectivity_check" != "mysql" ]; do 10 | /etc/init.d/mysql start 11 | database_connectivity_check=`mysqlshow --user=root | grep -o mysql` 12 | if [ $var -ge 2 ]; then 13 | exit 1 14 | fi 15 | var=$((var+1)) 16 | done 17 | ##Check for database 18 | database_availability_check=`mysqlshow --user=root | grep -ow "$MYSQL_DATABASE"` 19 | if [ "$database_availability_check" == "$MYSQL_DATABASE" ]; then 20 | exit 1 21 | else 22 | mysqladmin -u root password $MYSQL_ROOT_PASSWORD 23 | mysql -u root -p$MYSQL_ROOT_PASSWORD -e "create database $MYSQL_DATABASE;" 24 | mysql -u root -p$MYSQL_ROOT_PASSWORD -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '$MYSQL_ROOT_PASSWORD';" 25 | supervisorctl stop update_credentials && supervisorctl remove update_credentials 26 | fi 27 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | LABEL maintainer="Qloapps Support " 3 | ARG user=qloapps 4 | ##Php file configuration with php version and mysql version 5 | ENV mysql_version=5.7 php_version=7.2 file_uploads=On allow_url_fopen=On memory_limit=512M max_execution_time=240 upload_max_filesize=200M post_max_size=400M max_input_vars=1500 6 | ##Update server and install lamp server 7 | RUN apt-get update \ 8 | && export DEBIAN_FRONTEND=noninteractive \ 9 | && apt-get -y install apache2 \ 10 | && a2enmod rewrite \ 11 | && a2enmod headers \ 12 | && export LANG=en_US.UTF-8 \ 13 | && apt-get install -y software-properties-common \ 14 | && apt-get install -y language-pack-en-base \ 15 | && LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php \ 16 | && apt-get update \ 17 | && apt-get install -y php$php_version libapache2-mod-php$php_version php$php_version-bcmath php$php_version-cli php$php_version-json php$php_version-curl php$php_version-fpm php$php_version-gd php$php_version-ldap php$php_version-mbstring php$php_version-mysql php$php_version-soap php$php_version-sqlite3 php$php_version-xml php$php_version-zip php$php_version-intl php-imagick \ 18 | && echo "date.timezone = Asia/Kolkata" >> /etc/php/$php_version/apache2/php.ini \ 19 | && sed -i -e 's/memory_limit = .*/memory_limit = '${memory_limit}'/' -e 's/file_uploads = .*/file_uploads = '${file_uploads}'/' -e 's/allow_url_fopen = .*/allow_url_fopen = '${allow_url_fopen}'/' -e 's/max_execution_time = .*/max_execution_time = '${max_execution_time}'/' -e 's/upload_max_filesize = .*/upload_max_filesize = '${upload_max_filesize}'/' -e 's/post_max_size = .*/post_max_size = '${post_max_size}'/' -e 's/max_input_vars = .*/max_input_vars = '${max_input_vars}'/' /etc/php/$php_version/apache2/php.ini \ 20 | && apt-get -y install mysql-server-$mysql_version \ 21 | && apt-get install -y git nano vim curl openssh-server \ 22 | ##setup non root user 23 | && useradd -m -s /bin/bash ${user} \ 24 | && mkdir -p /home/${user}/www \ 25 | ##Download Qloapps latest version 26 | && cd /home/${user}/www && git clone https://github.com/webkul/hotelcommerce \ 27 | ##change file permission and ownership 28 | && find /home/${user}/www -type f -exec chmod 644 {} \; \ 29 | && find /home/${user}/www -type d -exec chmod 755 {} \; \ 30 | && chown -R ${user}: /home/${user}/www \ 31 | && sed -i "s@www-data@${user}@g" /etc/apache2/envvars \ 32 | && echo ' \n\ 33 | Options FollowSymLinks \n\ 34 | Require all granted \n\ 35 | AllowOverride all \n\ 36 | ' >> /etc/apache2/apache2.conf \ 37 | && sed -i "s@/var/www/html@/home/${user}/www/hotelcommerce@g" /etc/apache2/sites-enabled/000-default.conf \ 38 | ##install supervisor and setup supervisord.conf file 39 | && apt-get install -y supervisor \ 40 | && mkdir -p /var/log/supervisor 41 | COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf 42 | COPY credentials.sh /etc/credentials.sh 43 | RUN chmod a+x /etc/credentials.sh 44 | WORKDIR /home/${user}/www/hotelcommerce 45 | EXPOSE 3306 80 443 46 | CMD ["/usr/bin/supervisord"] 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## WHAT IS QLOAPPS 2 | 3 | Qloapps is an open source, free and customizable online reservation system. You can launch a userfriendly site and can manage online as well as offline bookings. Using this you can easily launch your hotel booking website and even manage your offline booking too. This package is developed on top of Prestashop 1.6. 4 | 5 | ## DOCKERIZING QLOAPPS 6 | 7 | Docker is an open-source project that can be integrated with almost all the applications allowing scope of isolation and flexibility. It can be integrated with Qloapps. 8 | 9 | ## PREREQUISITES 10 | 11 | > Install lastest avaiable Docker version and its dependencies according to your OS version. Refer to link https://docs.docker.com/install/linux/docker-ce/ubuntu/#prerequisites. 12 | 13 | > Check if your user has access privileges to run docker commands. 14 | 15 | #### NOTE TO THE USER 16 | 17 | > Mysql root password, Mysql Database name and SSH user password is not set. Users have to pass *Mysql root password, database name, and SSH user password* as arguments while running the docker image. 18 | 19 | > Default SSH user is created as "qloapps" while building this image. You can change user argument in Dockerfile and rebuild the docker image for your own use. 20 | 21 | > 22 | 23 | 24 | ## DOCKERIZING QLOAPPS 25 | 26 | In the dockerized Qloapps architecture, we are using: 27 | 28 | > Ubuntu 18.04 29 | 30 | > Mysql Server 5.7 31 | 32 | > PHP 7.2 33 | 34 | > SSH Server 35 | 36 | To begin with: 37 | 38 | 1. Pull qloapps docker image from docker hub by running command "docker pull webkul/qloapps:latest". 39 | 40 | 2. After pulling the image, run your qloapps container by specifying ports and arguments as: 41 | 42 | > docker run -tidp 80:80 -p 3306:3306 -p 2222:22 --name qloappsv150 -e USER_PASSWORD=qloappsuserpassword -e MYSQL_ROOT_PASSWORD=myrootpassword -e MYSQL_DATABASE=mydatabase webkul/qloapps_docker:latest 43 | 44 | 3. In the above command, your Host port 80 is linked with the docker port 80 running apache and Host port 3306 is linked with the docker port 3306 running MySQL, you can change the ports of your Host as per your requirements. Also, your SSH port 2222 is mapped with docker port 22 running SSH server. Please ensure that no other services are running on these host ports. 45 | 46 | 4. Mention your mysql root password, database name, 'qloapps' user password in arguments MYSQL_ROOT_PASSWORD, MYSQL_DATABASE and 47 | USER_PASSWORD respectively. 48 | 49 | 5. Check your running container using command *docker ps*. It will display you a container running with name qloappsv150. 50 | 51 | 6. Now go to your browser and hit your IP or domain name and start qloapps installation process 52 | 53 | 7. After qloapps installation, remove "install" directory from server root directory inside the container. Run command: 54 | 55 | > docker exec -i qloappsv150 rm -rf /home/qloapps/www/hotelcommerce/install . 56 | 57 | 8. On clicking on backoffice URL, you will be promped to rename your backoffice URL. Go to running docker container and change the name of admin directory as mentioned. 58 | 59 | 9. To access your qloapps files and directories, you can SSH in your docker container as: 60 | 61 | > ssh qloapps@mention_your_ip -p 2222 62 | 63 | Note -: If you are running any other services on your host at port 80, 22 and 3306 then you have to mention other ports in step 2. 64 | 65 | ## GETTING SUPPORT 66 | 67 | If you have any issues, contact us at support@qloapps.com or raise ticket at https://webkul.uvdesk.com/ 68 | 69 | 70 | Thank you. 71 | --------------------------------------------------------------------------------