Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment improvement #2

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env

This file was deleted.

4 changes: 4 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SERVER_NAME=127.0.0.1
POSTGRES_DB=taodb
POSTGRES_USER=postgres
POSTGRES_PASSWORD=dbpass
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
*.zip
*.*~

.env
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ This is a [Docker](https://www.docker.com/) build recipe for [Tao Testing](http:
The easiest way to fire this up is to follow these instructions:

### TAO Version 3.1+
1. Install Docker and Docker Compose
2. Modify the variables inside **setup.sh** and **.env** according to your needs and host parameters
3. Execute `sudo ./setup.sh` from the command line
1. Install Docker and Docker Compose (`./docker-ubuntu.sh`)
2. Copy `.env.template` file to `.env` and update parameters according to your environment
3. Run with `sudo ./up.sh` from the command line (`sudo ./up.sh -d` in detached mode)
4. Open http://your-host and follow installation wizard
* Use **pgdb** as **database host** name
* Use **TAO_POSTGRES_DB** value from **setup.sh** as **database name**
* Use **POSTGRES_DB**, **POSTGRES_USER**, **POSTGRES_PASSWORD** values from **.env** file
* Select the **Overwrite option**

**Note:** OPCache is enabled in the php.ini.
Expand Down
58 changes: 58 additions & 0 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
FROM php:5.6.30-apache
#FROM php:7.0.5-apache

MAINTAINER Vladyslav Kurmaz <vladislav.kurmaz@gmail.com>

ARG SERVER_NAME
ENV SERVER_NAME=$SERVER_NAME

RUN export DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND noninteractive
RUN dpkg-divert --local --rename --add /sbin/initctl

# Use local cached debs from host (saves your bandwidth!)
# Change ip below to that of your apt-cacher-ng host
# Or comment this line out if you do not wish to use caching
ADD ./dist/71-apt-cacher-ng /etc/apt/apt.conf.d/71-apt-cacher-ng

RUN apt-get -y update && \
apt-get install -y \
curl \
libcurl4-gnutls-dev \
libpng-dev \
libpq-dev \
libxml2-dev \
libtidy-dev \
unzip \
mc


RUN docker-php-ext-install -j$(nproc) \
curl \
gd \
pdo_pgsql \
zip \
tidy \
xml


RUN a2enmod rewrite

ADD http://releases.taotesting.com/TAO_3.1.0-RC7_build.zip /tmp/TAO_3.1.0-RC7_build.zip
ADD https://github.com/mathjax/MathJax/archive/2.7.0.zip /tmp/2.7.0.zip

WORKDIR /tmp

RUN unzip -q TAO_3.1.0-RC7_build.zip; \
mv TAO_3.1.0-RC7_build web; \
mv web /home/; \
unzip -q 2.7.0.zip; \
mv MathJax-2.7.0/* /home/web/taoQtiItem/views/js/mathjax/; \
chown -R www-data.www-data /home/web

ADD ./dist/apache.conf /etc/apache2/sites-enabled/000-default.conf
RUN sed -i -e "s/SERVER_NAME/${SERVER_NAME}/g" /etc/apache2/sites-enabled/000-default.conf

ADD ./dist/php.ini /usr/local/etc/php/

#CMD ["/usr/sbin/apachectl", "-D", "FOREGROUND"]
3 changes: 3 additions & 0 deletions apache/dist/71-apt-cacher-ng
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Acquire::http { Proxy "http://192.168.40.104:3142"; };
#Acquire::http { Proxy "http://192.168.2.9:3142"; };
#Acquire::http { Proxy "http://192.168.1.13:3142"; };
22 changes: 22 additions & 0 deletions apache/dist/apache.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<VirtualHost *:80>

ServerName SERVER_NAME
ServerAdmin webmaster@localhost

ErrorLog /var/log/apache2/tao.error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/tao.access.log combined

DocumentRoot /home/web

<Directory /home/web >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>

</VirtualHost>
Loading