Fix receipt barcode generation for docker (add php5-gd lib to Dockerfile) (#284)

Make setup scripts with CI3
This commit is contained in:
jekkos
2016-01-21 18:22:04 +01:00
parent 9048d68baf
commit 192955b33d
5 changed files with 8 additions and 9 deletions

View File

@@ -2,10 +2,10 @@ FROM ubuntu:trusty
MAINTAINER jekkos
RUN apt-get update
RUN apt-get -y upgrade
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-client mysql-server apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql
RUN DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-client mysql-server apache2 libapache2-mod-php5 pwgen python-setuptools vim-tiny php5-mysql php5-gd
RUN easy_install supervisor
ADD ./foreground.sh /etc/apache2/foreground.sh
ADD ./supervisord.conf /etc/supervisord.conf
ADD ./docker/foreground.sh /etc/apache2/foreground.sh
ADD ./docker/supervisord.conf /etc/supervisord.conf
RUN chmod 755 /etc/apache2/foreground.sh
# Install dependencies
RUN apt-get install -y --no-install-recommends software-properties-common
@@ -15,11 +15,11 @@ RUN apt-get install -y python git
# Get latest Ospos source from Git
RUN git clone https://github.com/jekkos/opensourcepos.git /app
RUN cd app && git checkout develop/2.4
# RUN cd app && git checkout develop/2.4
# RUN cd app && npm install
RUN ln -fs /app/* /var/www/html
ADD ./start_container.sh /start_container.sh
ADD ./docker/start_container.sh /start_container.sh
RUN chmod 755 /start_container.sh
EXPOSE 80 3306
CMD ["/bin/bash", "/start_container.sh"]

View File

View File

@@ -8,10 +8,9 @@ if [ ! -f /mysql-configured ]; then
[ -f /var/www/html/index.html ] && rm /var/www/html/index.html
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
sed -i "s/\(password..=..\).*/\1'${MYSQL_PASSWORD}',/g" /app/application/config/database.php
sed -i "s/\(database..=..\).*/\1'ospos',/g" /app/application/config/database.php
sed -i "s/\(username..=..\).*/\1'root',/g" /app/application/config/database.php
sed -i -e "s/\(user.*\?=.\).*\(.\)$/\1'root'\2/g" /app/application/config/database.php
sed -i -e "s/\(password.*\?=.\).*\(.\)$/\1'${MYSQL_PASSWORD}'\2/g" /app/application/config/database.php
sed -i -e "s/\(database.*\?=.\).*\(.\)$/\1'ospos'\2/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

View File