From 2d0b20499e53cef2502160ce9cab4baf80f2be6d Mon Sep 17 00:00:00 2001 From: jekkos Date: Mon, 11 Jan 2016 18:53:57 +0100 Subject: [PATCH 1/5] Set correct locale for Dutch (Belgium) --- application/views/configs/locale_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/configs/locale_config.php b/application/views/configs/locale_config.php index 47a11717f..ff9bd2794 100644 --- a/application/views/configs/locale_config.php +++ b/application/views/configs/locale_config.php @@ -57,7 +57,7 @@ echo form_open('config/save_locale/',array('id'=>'locale_config_form')); 'en' => 'English', 'es' => 'Spanish', 'ru' => 'Russian', - 'nl-BE' => 'Dutch', + 'nl-BE' => 'Dutch (Belgium)', 'de-CH' => 'German (Swiss)', 'zh' => 'Chinese', 'id' => 'Indonesian', From a1ad99cc0d651486d04db0fa4cfe92045c34938e Mon Sep 17 00:00:00 2001 From: jekkos Date: Tue, 12 Jan 2016 16:45:18 +0100 Subject: [PATCH 2/5] Add Dockerfile. Ospos is now containerized. Pull image from docker build -t me/ospos git://github.com/jekkos/opensourcepos.git then run docker run -it me/opensourcepos And head to port 80 to login to a new ospos install. --- Dockerfile | 17 +++++++++++++++++ start_container.sh | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 Dockerfile create mode 100644 start_container.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..07aa6ddec --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM jbfink/docker-lampstack +MAINTAINER jekkos +# Install dependencies +RUN apt-get install -y --no-install-recommends software-properties-common +RUN apt-get install -y python git +RUN apt-get update +# RUN add-apt-repository ppa:chris-lea/node.js + +# Get latest Ospos source from Git +RUN git clone https://github.com/jekkos/opensourcepos.git /app +# RUN cd app && npm install + +RUN ln -fs /app/* /var/www +ADD ./start_container.sh /start_container.sh +RUN chmod 755 /start_container.sh +EXPOSE 80 3306 +CMD ["/bin/bash", "/start_container.sh"] diff --git a/start_container.sh b/start_container.sh new file mode 100644 index 000000000..342a27d08 --- /dev/null +++ b/start_container.sh @@ -0,0 +1,16 @@ +#!/bin/bash +if [ ! -f /mysql-configured ]; then + /usr/bin/mysqld_safe & + sleep 10s + MYSQL_PASSWORD=`pwgen -c -n -1 12` + echo mysql root password: $MYSQL_PASSWORD + echo $MYSQL_PASSWORD > /mysql-root-pw.txt + mysqladmin -u root password $MYSQL_PASSWORD + cp /app/application/config/database.php.tmpl /app/application/config/database.php + sed -i "s/\(password...=.\).*/\1'${MYSQL_PASSWORD}';/g" /app/application/config/database.php + mysql -e "CREATE DATABASE IF NOT EXISTS ospos; use ospos; source /app/database/tables.sql; source /app/database/constraints.sql;" -uroot -p${MYSQL_PASSWORD} + touch /mysql-configured + killall mysqld + sleep 10s +fi +supervisord -n From d0c765ce20eb70fccd24a590cab3ab9233511fd4 Mon Sep 17 00:00:00 2001 From: Aaron Gong Date: Wed, 13 Jan 2016 15:58:20 +0800 Subject: [PATCH 3/5] PHP7 fix Change driver from mysql to mysqli --- application/config/database.php.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/config/database.php.tmpl b/application/config/database.php.tmpl index 325b4af50..eff205f30 100644 --- a/application/config/database.php.tmpl +++ b/application/config/database.php.tmpl @@ -52,7 +52,7 @@ $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'root'; $db['default']['password'] = ''; $db['default']['database'] = 'ospos'; -$db['default']['dbdriver'] = 'mysql'; +$db['default']['dbdriver'] = 'mysqli'; $db['default']['dbprefix'] = 'ospos_'; $db['default']['pconnect'] = FALSE; $db['default']['db_debug'] = TRUE; From 2f0666325ffc9f80271fb01b1e050ccb77c01926 Mon Sep 17 00:00:00 2001 From: Aaron Gong Date: Wed, 13 Jan 2016 15:59:37 +0800 Subject: [PATCH 4/5] PHP7 Fix Use __construct as constructor instead of Class name --- application/core/MY_Lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/core/MY_Lang.php b/application/core/MY_Lang.php index 657f7b5c3..892dc6964 100644 --- a/application/core/MY_Lang.php +++ b/application/core/MY_Lang.php @@ -3,7 +3,7 @@ class MY_Lang extends CI_Lang { - function MY_Lang() + function __construct() { parent::__construct(); } From 1a77960daae2c12eebd2bf0f9acc29e0d8b78139 Mon Sep 17 00:00:00 2001 From: jekkos Date: Wed, 13 Jan 2016 18:57:44 +0100 Subject: [PATCH 5/5] Update README.md with instructions for Docker setup --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 9b196d8b0..633be35c5 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,17 @@ username: admin password:pointofsale 9. Enjoy +13/01/2016: Intall using Docker +------------------------------- +From now on ospos can be deployed using Docker on Linux, Mac or Windows. This setup dramatically reduces the number of possible issues as all setup is now done in a Dockerfile. Docker runs natively on mac and linux, but will require more overhead on windows. Please refer to the docker documentation for instructions on how to set it up on your platform. + +To build and run the image, issue following commands in a terminal with docker installed + + docker build -t me/ospos https://github.com/jekkos/opensourcepos.git + docker run -d -p 80:80 me/ospos + +Docker will clone the latest master into the image and start a LAMP stack with the application configured. + A more extensive setup guide can be found at [this site](http://www.opensourceposguide.com/guide/gettingstarted/installation) If you like the project, and you are making money out of it on a daily basis, then consider to buy me a coffee so I can keep adding features.