Merge remote-tracking branch 'jekkos/master' into ci3

# Conflicts:
#	application/config/database.php.tmpl
This commit is contained in:
FrancescoUK
2016-01-15 18:57:11 +00:00
5 changed files with 46 additions and 2 deletions

17
Dockerfile Normal file
View File

@@ -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"]

View File

@@ -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.

View File

@@ -3,7 +3,7 @@
class MY_Lang extends CI_Lang
{
function MY_Lang()
function __construct()
{
parent::__construct();
}

View File

@@ -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',

16
start_container.sh Normal file
View File

@@ -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