Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.

Commit

Permalink
Building a docker image.
Browse files Browse the repository at this point in the history
  • Loading branch information
dashohoxha committed Sep 25, 2014
1 parent 42cd3d0 commit f868baa
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 12 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### This file can be used to build a docker image like this:
### docker build --tag='btr_server' .
### It can also be used for automated builds in Docker Hub
### (see https://docs.docker.com/userguide/dockerrepos/#automated-builds)

FROM ubuntu:14.04

### Install packages first, in order to take advantage
### of caching features of `docker build`.
COPY install/scripts/packages-and-software.sh /tmp/
RUN DEBIAN_FRONTEND=noninteractive /tmp/packages-and-software.sh

### Copy the source code and run the installer.
COPY . /usr/local/src/btr_server/
ENV code_dir /usr/local/src/btr_server
WORKDIR /usr/local/src/btr_server/
RUN ["install/install-container.sh", "install/settings.sh"]

### Set the default command to run in the container.
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf", "--nodaemon"]

17 changes: 17 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ This is a Drupal installation profile for B-Translator Server.
/etc/init.d/chroot-btr stop
#+END_EXAMPLE


* Installation in a docker container

This is almost the same as the installation above, except that
Expand All @@ -46,6 +47,22 @@ This is a Drupal installation profile for B-Translator Server.
docker.io stop btr
#+END_EXAMPLE

Compared to the installation with chroot, docker has the advantage
that it is platform independent (the host system does not have to be
Ubuntu or Debian).


* Building with docker

Another way is to use the command =docker build= to build an image
and then =docker run= to create a container from this image:
#+BEGIN_EXAMPLE
vim btr_server/install/settings.sh
docker.io build --tag=btr_server btr_server/
docker.io run -d --name=btr --hostname=btr.example.org \
-p 80:80 -p 443:443 btr_server
#+END_EXAMPLE


* What is B-Translator

Expand Down
6 changes: 2 additions & 4 deletions install/install-and-config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ sed -i /etc/hosts \
-e "/^127.0.0.1/c 127.0.0.1 btr.example.org localhost"
hostname btr.example.org

### export drupal_dir
export drupal_dir=/var/www/btr
export drush="drush --root=$drupal_dir"

### go to the directory of scripts
cd $code_dir/install/scripts/

### additional packages and software
./packages-and-software.sh

### make and install the drupal profile 'btr_server'
export drupal_dir=/var/www/btr
export drush="drush --root=$drupal_dir"
./drupal-make-and-install.sh

### move translation tables on their own database
Expand Down
14 changes: 6 additions & 8 deletions install/scripts/packages-and-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@
apt-get update
apt-get -y upgrade

install='apt-get -y -o DPkg::Options::=--force-confdef -o DPkg::Options::=--force-confold install'

### install localization
$install language-pack-en
apt-get -y install language-pack-en
update-locale

### install other needed packages
$install aptitude tasksel vim nano psmisc cron supervisor
$install mysql-server ssmtp memcached php5-memcached \
apt-get -y install aptitude tasksel vim nano psmisc cron supervisor
apt-get -y install mysql-server ssmtp memcached php5-memcached \
php5-mysql php5-gd php-db php5-dev php-pear php5-curl php-apc \
make ssl-cert gawk unzip wget curl diffutils phpmyadmin git ruby \
mercurial subversion translate-toolkit dtrx
$install screen logwatch
apt-get -y install screen logwatch
initctl reload-configuration

### install hub: http://hub.github.com/
Expand All @@ -25,7 +23,7 @@ chmod +x /bin/hub

### install twitter cli client
### see also: http://xmodulo.com/2013/12/access-twitter-command-line-linux.html
$install ruby-dev
apt-get -y install ruby-dev
gem install t

### phpmyadmin will install apache2 and start it
Expand All @@ -34,7 +32,7 @@ gem install t
update-rc.d apache2 disable

### install nginx and php5-fpm
$install nginx nginx-common nginx-full php5-fpm
apt-get -y install nginx nginx-common nginx-full php5-fpm

### There is some problem with php-pear in 14.04
### See: http://askubuntu.com/questions/451953/php-pear-is-not-working-after-upgrading-to-ubuntu-14-04
Expand Down

0 comments on commit f868baa

Please sign in to comment.