Skip to content

Commit 2dc4f29

Browse files
committed
update to use mariadb and ubuntu:16.04 image
1 parent 39aa14c commit 2dc4f29

File tree

4 files changed

+33
-25
lines changed

4 files changed

+33
-25
lines changed

Dockerfile

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,40 @@
22
# dockerfile for datazoomer
33
#
44

5-
FROM ubuntu:14.04
5+
FROM ubuntu:16.04
66

77
MAINTAINER Herb Lainchbury <herb@dynamic-solutions.com>
88

9-
109
# install os packages
1110
RUN apt-get update
1211
RUN apt-get -y install \
1312
apache2 \
1413
git \
15-
mysql-client \
16-
mysql-server \
14+
vim \
1715
python-imaging \
18-
python-MySQLdb \
16+
python-mysqldb \
1917
python-pip \
2018
libxml2-dev \
2119
libxslt1-dev \
2220
libffi-dev \
2321
libssl-dev \
2422
python-dev
2523

26-
2724
# configure apache modules
28-
RUN cd /etc/apache2/mods-enabled && sudo ln -s ../mods-available/rewrite.load
29-
RUN cd /etc/apache2/mods-enabled && sudo ln -s ../mods-available/cgi.load
30-
31-
32-
# install pip and python libraries
33-
RUN pip install --upgrade pip
34-
RUN pip install \
35-
BeautifulSoup \
36-
markdown \
37-
nose \
38-
faker \
39-
pyrss2gen \
40-
bcrypt \
41-
scrypt
42-
run pip install -Iv passlib==1.6.2
25+
RUN cd /etc/apache2/mods-enabled && ln -s ../mods-available/rewrite.load
26+
RUN cd /etc/apache2/mods-enabled && ln -s ../mods-available/cgi.load
4327

28+
# install mariadb
29+
ADD setup_mariadb.sh /tmp/setup_mariadb.sh
30+
RUN /bin/bash /tmp/setup_mariadb.sh
4431

4532
# upload scripts
4633
ADD setup.sh /tmp/setup.sh
4734
ADD start.sh /tmp/start.sh
4835

49-
5036
# run the final setup
5137
RUN /bin/bash /tmp/setup.sh
5238

53-
5439
# run the server
5540
EXPOSE 80
5641
CMD ["/bin/bash", "/tmp/start.sh"]

setup.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ mv dsi.pth /usr/local/lib/python2.7/dist-packages
2424

2525
# install datazoomer library
2626
git clone https://github.com/dsilabs/datazoomer.git /work/source/libs/datazoomer
27+
pip install -r /work/source/libs/datazoomer/requirements.txt
2728
ln -s /work/source/libs/datazoomer/zoom /work/lib
2829

2930
# setup the default theme
@@ -35,10 +36,21 @@ rm -f 000-default*
3536
ln -s /work/source/libs/datazoomer/setup/apache/zoom zoom.conf
3637
sed -i'' 's/Listen 80/ServerName localhost\n\nlisten 80/' /etc/apache2/ports.conf
3738

39+
apt-get install vim
40+
3841
# setup datazoomer config files
3942
echo -e "[sites]\\npath=/work/web/sites" > /work/dz.conf
4043
echo -e "[sites]\\npath=/work/web/sites" > /work/web/dz.conf
4144
cp /work/source/libs/datazoomer/sites/default/site.ini /work/web/sites/default/site.ini
45+
mkdir /work/web/sites/localhost
46+
cat <<EOT | tee "/work/web/sites/localhost/site.ini"
47+
[database]
48+
engine=mysql
49+
dbname=zoomdata
50+
dbhost=localhost
51+
dbuser=zoomuser
52+
dbpass=zoompass
53+
EOT
4254

4355
# setup the www server folder
4456
ln -s /work/source/libs/datazoomer/setup/www/static/dz /work/web/www/static

setup_mariadb.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
# setup mariadb
3+
apt-get install software-properties-common
4+
apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
5+
add-apt-repository 'deb [arch=amd64,i386,ppc64el] http://mariadb.mirror.colo-serv.net/repo/10.1/ubuntu xenial main'
6+
apt-get update
7+
echo mariadb-server-10.1 mysql-server/root_password password root | debconf-set-selections
8+
echo mariadb-server-10.1 mysql-server/root_password_again password root | debconf-set-selections
9+
apt-get -y -q install mariadb-server

start.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11

22
# create database
33
service mysql start
4-
echo "create database zoomdata" | mysql -u root
5-
mysql -u root zoomdata < /work/source/libs/datazoomer/setup/database/setup_mysql.sql
4+
echo "create database zoomdata" | mysql -u root -proot
5+
mysql -u root -proot zoomdata < /work/source/libs/datazoomer/setup/database/setup_mysql.sql
6+
mysql -u root -proot -e "create user zoomuser identified by 'zoompass'"
7+
mysql -u root -proot -e "grant all on zoomdata.* to zoomuser@'%'"
68

79
# start apache
810
/usr/sbin/apache2ctl -D FOREGROUND

0 commit comments

Comments
 (0)