diff --git a/Dockerfile b/Dockerfile index a53da12b..01fb597b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 libapache2-mod-php #RUN php5enmod openssl RUN a2enmod php5 RUN a2enmod rewrite +RUN a2enmod headers # Update the PHP.ini file, enable tags and quieten logging. RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" /etc/php5/apache2/php.ini @@ -34,10 +35,12 @@ ENV APACHE_PID_FILE /var/run/apache2.pid EXPOSE 80 # Copy site into place. -#ADD app /var/www/site/app +ADD . /var/www/cmc-sales # Update the default apache site with the config we created. -#ADD apache-config.conf /etc/apache2/sites-enabled/000-default.conf +ADD conf/apache-vhost.conf /etc/apache2/sites-available/cmc-sales +RUN a2dissite 000-default +RUN a2ensite cmc-sales # By default, simply start apache. CMD /usr/sbin/apache2ctl -D FOREGROUND diff --git a/build_docker.sh b/build_docker.sh new file mode 100644 index 00000000..0267e4ae --- /dev/null +++ b/build_docker.sh @@ -0,0 +1,3 @@ +ID=$(docker ps -f ancestor=cmc:latest -q) +docker kill $ID +docker build . -t "cmc:latest" diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 00000000..9d0d4f87 --- /dev/null +++ b/deploy.sh @@ -0,0 +1 @@ +ansible-playbook -i ../cmc-playbooks/inventory.txt ../cmc-playbooks/deploy.yml diff --git a/enter_docker.sh b/enter_docker.sh new file mode 100644 index 00000000..724907d1 --- /dev/null +++ b/enter_docker.sh @@ -0,0 +1,2 @@ +ID=$(docker ps -f ancestor=cmc:latest -q) +docker exec -it $ID /bin/bash diff --git a/run_docker.sh b/run_docker.sh new file mode 100644 index 00000000..10dc0878 --- /dev/null +++ b/run_docker.sh @@ -0,0 +1,4 @@ +ID=$(docker ps -f ancestor=cmc:latest -q) +docker kill $ID +sleep 1 +docker run -d -p 8888:80 --env-file environment_vars cmc:latest