diff --git a/Dockerfile b/Dockerfile index 78b2247..5cd8ac7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,19 +17,18 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::= libsoap-lite-perl libxmlrpc-lite-perl libjson-rpc-perl libjson-xs-perl libtext-csv-perl libhtml-strip-perl \ libtext-csv-xs-perl libspreadsheet-parseexcel-perl libspreadsheet-xlsx-perl \ liblingua-stem-snowball-perl libtheschwartz-perl \ - libdaemon-generic-perl libhttp-server-simple-perl libnet-server-perl + libdaemon-generic-perl libhttp-server-simple-perl libnet-server-perl build-essential ADD etc /etc -ADD home /home -ADD usr /usr RUN service mysql start && echo "CREATE DATABASE bugzilla; \ GRANT ALL PRIVILEGES ON bugzilla.* TO bugzilla@localhost IDENTIFIED BY 'bugzilla'; \ FLUSH PRIVILEGES;" | mysql --defaults-file=/etc/mysql/debian.cnf -RUN cpan CGI Math::Random::Secure Sys::Sendfile Date::Parse Text::Wrap MIME::Parser +RUN cpan Module::Build CGI Math::Random::Secure Sys::Sendfile Date::Parse Text::Wrap MIME::Parser -RUN mv /var/lib/mysql /home/data/mysql && \ +RUN mkdir /home/data && \ + mv /var/lib/mysql /home/data/mysql && \ mv /var/lib/sphinxsearch /home/data/sphinxsearch && \ ln -s /home/data/mysql /var/lib/mysql && \ ln -s /home/data/sphinxsearch /var/lib/sphinxsearch && \ @@ -47,7 +46,13 @@ RUN mv /var/lib/mysql /home/data/mysql && \ chown www-data:www-data /home/data/bugzilla && \ ln -s /home/data/bugzilla data -ADD localconfig /home/bugzilla/localconfig +ADD home /home + +RUN service sphinxsearch start && \ + service mysql start && \ + cd /home/bugzilla && \ + ./checksetup.pl answers && \ + rm answers # Update image incrementally diff --git a/README.md b/README.md new file mode 100644 index 0000000..281061e --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# Bugzilla4Intranet Docker image + +build it: + + docker build -t bugzilla4intranet . + +Run it: + + docker run --name bz4i -p 8158:8157 -v /home/data -t -d bugzilla4intranet + +Then point your browser to localhost:8158 and configure your Bugzilla. + +# Docker cheatsheet + +Some basic commands to work with the resulting container: + +* list running containers: `docker ps` +* list all containers: `docker ps -a` +* list system images: `docker images` +* stop container: `docker stop mw4i` +* start container again: `docker start mw4i` +* run shell in the container: `docker exec -it mw4i bash` +* remove container: `docker rm ` +* remove image: `docker rmi ` + +P.S: If you get "Cannot connect to the Docker daemon. Is the docker daemon running on this host?" error, +add your system user into `docker` group **and relogin**! diff --git a/etc/sphinxsearch/sphinx.conf b/etc/sphinxsearch/sphinx.conf index e16a5f0..4b88fcc 100644 --- a/etc/sphinxsearch/sphinx.conf +++ b/etc/sphinxsearch/sphinx.conf @@ -7,7 +7,8 @@ index bugzilla rt_field = short_desc rt_field = comments rt_field = comments_private - docinfo = extern + rt_attr_uint = id + docinfo = inline charset_table = 0..9, A..Z->a..z, a..z, U+410..U+42F->U+430..U+44F, U+430..U+44F blend_chars = _, -, &, +, @, $ morphology = stem_enru diff --git a/home/bugzilla/answers b/home/bugzilla/answers new file mode 100644 index 0000000..4d3453a --- /dev/null +++ b/home/bugzilla/answers @@ -0,0 +1,4 @@ +$answer{'ADMIN_EMAIL'} = 'admin@bugzilla.4intra.net'; +$answer{'ADMIN_PASSWORD'} = 'bugzilla'; +$answer{'ADMIN_REALNAME'} = 'Bugzilla4Intranet admin'; +$answer{'NO_PAUSE'} = 1; diff --git a/localconfig b/home/bugzilla/localconfig similarity index 100% rename from localconfig rename to home/bugzilla/localconfig diff --git a/home/start.sh b/home/start.sh new file mode 100755 index 0000000..903f546 --- /dev/null +++ b/home/start.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +export LC_ALL=ru_RU.UTF-8 LANG=ru_RU.UTF-8 + +service sphinxsearch start +service mysql start +service bugzilla start + +# Keep container running +tail -fn0 /dev/null