Merge branch 'develop'

This commit is contained in:
STAM 2020-07-30 18:20:06 +03:00
commit f03ed1d5ef
14 changed files with 281 additions and 2062 deletions

View File

@ -169,12 +169,18 @@ matrix:
- docker push epicmorg/balancer:php
- name: Apache + PHP7.4
- name: Apache (latest)
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build --compress -t epicmorg/websites:latest websites/latest
- docker push epicmorg/websites:latest
- name: Apache + PHP7.4
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build --compress -t epicmorg/websites:latest websites/php7.4
- docker push epicmorg/websites:php7.4
- name: Apache + PHP7.3
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
@ -187,7 +193,11 @@ matrix:
- docker build --compress -t epicmorg/websites:php7.2 websites/php7.2
- docker push epicmorg/websites:php7.2
##########
- name: Testrail (always latest)
script:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build --compress -t epicmorg/testrail:latest tesrtail
- docker push epicmorg/testrail:latest
- name: PostgresSQL (latest)
script:

41
testrail/Dockerfile Normal file
View File

@ -0,0 +1,41 @@
FROM epicmorg/websites:php7.2
ARG TESTRAIL_VERSION=latest
ARG DOWNLOAD_URL=https://secure.gurock.com/downloads/testrail/testrail-${TESTRAIL_VERSION}-ion71.zip
ARG TESTRAIL_RELEASE_DIR=testrail-release
ENV TR_DEFAULT_TASK_EXECUTION=60
ENV TR_CONFIGPATH="/var/www/testrail/config/"
ENV TR_DEFAULT_LOG_DIR="/opt/testrail/logs/"
ENV TR_DEFAULT_AUDIT_DIR="/opt/testrail/audit/"
ENV TR_DEFAULT_REPORT_DIR="/opt/testrail/reports/"
ENV TR_DEFAULT_ATTACHMENT_DIR="/opt/testrail/attachments/"
ENV OPENSSL_CONF=/etc/ssl/
RUN \
apt-get update && \
apt-get install -y --no-install-recommends curl zip unzip wget iputils-ping mariadb-client openssl && \
apt-get install -y --no-install-recommends zlib1g-dev libcurl4-gnutls-dev libldap2-dev zlib1g-dev libxml2-dev libfontconfig1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /run.sh
RUN \
echo "WGET" && \
mkdir -p /${TESTRAIL_RELEASE_DIR} && \
mkdir -p /var/www/testrail && \
mkdir -p /opt/testrail/attachments /opt/testrail/reports /opt/testrail/logs /opt/testrail/audit && \
wget --no-check-certificate -O /${TESTRAIL_RELEASE_DIR}/testrail.zip ${DOWNLOAD_URL} && \
chown -R www-data:www-data /${TESTRAIL_RELEASE_DIR} && \
chown -R www-data:www-data /var/www/testrail && \
chown -R www-data:www-data /opt/testrail
COPY apache_testrail.conf /${TESTRAIL_RELEASE_DIR}/apache-conf/000-default.conf
COPY run.sh /run.sh
WORKDIR /var/www/testrail
EXPOSE 80
CMD ["/run.sh"]

View File

@ -6,4 +6,11 @@
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>

View File

@ -1,3 +0,0 @@
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

View File

@ -1,72 +0,0 @@
ARG ARG_PHP_VERSION=7.2
FROM php:${ARG_PHP_VERSION}-apache
ARG ARG_PHP_VERSION=7.2
ARG ARG_IONCUBE_VERSION=10.3.2
ARG ARG_URL=https://secure.gurock.com/downloads/testrail/testrail-latest-ion71.zip
ENV TR_DEFAULT_TASK_EXECUTION=60
ENV TR_CONFIGPATH="/var/www/testrail/config/"
ENV TR_DEFAULT_LOG_DIR="/opt/testrail/logs/"
ENV TR_DEFAULT_AUDIT_DIR="/opt/testrail/audit/"
ENV TR_DEFAULT_REPORT_DIR="/opt/testrail/reports/"
ENV TR_DEFAULT_ATTACHMENT_DIR="/opt/testrail/attachments/"
ENV OPENSSL_CONF=/etc/ssl/
LABEL vendor="TestRail" \
maintainer="Christian Breitwieser" \
email="cbreitwieser@ranorex.com" \
type="TestRail php-fpm apache image including ionCube loader." \
description="This is an image which runs apache php-fpm with ionCube for testrail."
RUN \
apt-get update && \
apt-get install -y --no-install-recommends curl zip unzip wget iputils-ping mariadb-client openssl && \
apt-get install -y --no-install-recommends zlib1g-dev libcurl4-gnutls-dev libldap2-dev zlib1g-dev libxml2-dev libfontconfig1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN \
docker-php-ext-install mbstring && \
if [ "x$ARG_PHP_VERSION" = "5."* ] ; then docker-php-ext-install mysql; \
else docker-php-ext-install mysqli; \
fi && \
docker-php-ext-install curl && \
docker-php-ext-install zip && \
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu && \
docker-php-ext-install ldap
RUN \
wget --no-check-certificate -O /tmp/testrail.zip ${ARG_URL} && \
mkdir -p /var/www/testrail && \
mkdir -p /opt/testrail/attachments /opt/testrail/reports /opt/testrail/logs /opt/testrail/audit && \
unzip /tmp/testrail.zip -d /var/www/ && \
rm /tmp/testrail.zip && \
chown -R www-data:www-data /var/www/testrail && \
chown -R www-data:www-data /opt/testrail
COPY php.ini /usr/local/etc/php/conf.d/php.ini
RUN \
wget -O /tmp/ioncube.tar.gz http://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64_${ARG_IONCUBE_VERSION}.tar.gz && \
tar -xzf /tmp/ioncube.tar.gz -C /tmp && \
mv /tmp/ioncube /opt/ioncube && \
echo zend_extension=/opt/ioncube/ioncube_loader_lin_${ARG_PHP_VERSION}.so >> /usr/local/etc/php/php.ini && \
rm -f /tmp/ioncube.tar.gz
RUN mkdir -p /apache-conf
VOLUME /apache-conf
RUN mkdir -p /etc/apache2/ssl
VOLUME /etc/apache2/ssl
COPY apache_testrail.conf /apache-conf/000-default.conf
COPY ssl_apache_testrail.conf /apache-conf/ssl_apache_testrail.conf
COPY .htaccess /apache-conf/.htaccess
COPY custom-entrypoint.sh /custom-entrypoint.sh
ENTRYPOINT ["/custom-entrypoint.sh"]
CMD ["apache2-foreground"]
WORKDIR /var/www/testrail
EXPOSE 80

View File

@ -1,13 +0,0 @@
# Testrail Apache PHP-FPM image
To be extendeded...
## How to build the image?
The build supports `ARG_PHP_VERSION`, `ARG_IONCUBE_VERSION`, and `ARG_URL` as arguments as shown below.
```
docker build --build-arg ARG_PHP_VERSION=7.2 --build-arg ARG_IONCUBE_VERSION=10.3.9 --build-arg ARG_URL='https://secure.gurock.com/downloads/testrail/testrail-latest-ion70.zip' -t testrail/apache:6.0 .
```
__Please note:__ When proving a custom zip-file, ensure that it also fits the php-version provided!

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +0,0 @@
<VirtualHost *:443>
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/testrail
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/certificate.crt
SSLCertificateKeyFile /etc/apache2/ssl/key.pem
SSLCertificateChainFile /etc/apache2/ssl/certificate.crt
ErrorLog ${APACHE_LOG_DIR}/ssl_error.log
CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined
</VirtualHost>

View File

@ -11,24 +11,11 @@ function createOptDirectory {
chown -R www-data:www-data $1
}
rm -f /etc/apache2/sites-enabled/ssl_apache_testrail.conf
cp /apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
/bin/cp -rf /testrail-release/apache-conf/000-default.conf /etc/apache2/sites-enabled/000-default.conf
if [ ! -z "$SSL" ]
then
echo
echo "####################################################"
echo " Applying SSL configuration -- please ensure that certificate and key files exist"
echo "####################################################"
echo
# Enable SSL
a2enmod ssl
cp -f /apache-conf/ssl_apache_testrail.conf /etc/apache2/sites-enabled/ssl_apache_testrail.conf
# Perform redirection from HTTPto HTTPS
a2enmod rewrite
cp -f /apache-conf/.htaccess /var/www/testrail/.htaccess
fi
echo "##############"
echo "Unzipping testrail"
unzip /testrail-release/testrail.zip -d /var/www/
createOptDirectory $TR_DEFAULT_LOG_DIR
createOptDirectory $TR_DEFAULT_AUDIT_DIR
@ -53,4 +40,8 @@ while /bin/true; do
done &
echo "##############"
docker-php-entrypoint "$@"
chown www-data:www-data /var/www -R
source /etc/apache2/envvars
tail -F /var/log/apache2/* &
exec apache2 -D FOREGROUND

171
websites/php7.4/Dockerfile Normal file
View File

@ -0,0 +1,171 @@
FROM epicmorg/edge
LABEL maintainer="EpicMorg DevTeam, developer@epicm.org"
ARG DEBIAN_FRONTEND=noninteractive
##################################################################
# Installing Apache2 + PHP7
##################################################################
#installing php repo
RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg
RUN sh -c 'echo "deb https://packages.sury.org/php/ buster main" > /etc/apt/sources.list.d/php.list'
#installing apache2 repo
RUN wget -O /etc/apt/trusted.gpg.d/apache2.gpg https://packages.sury.org/apache2/apt.gpg
RUN sh -c 'echo "deb https://packages.sury.org/apache2/ buster main" > /etc/apt/sources.list.d/apache2.list'
#Install base packages
RUN apt-get update && \
apt-get install -y --allow-unauthenticated \
apache2 \
apache2-utils \
libapache2-mod-php7.4 \
libapache2-mod-webauth \
libapache2-mod-xforward \
libapache2-mod-security2 \
libmemcached-dev \
php7.4 \
php7.4-dev \
php7.4-fpm \
php7.4-cli \
php7.4-cgi \
php-pear \
php-gmp \
php-snmp \
php-ldap \
php-mail \
# php-mailparse \
php-soap \
php-mysql \
php-memcached \
php-memcache \
php-igbinary \
php-curl \
php-gd \
php-intl \
php-zip \
php-bcmath \
php-imap \
php-pspell \
php-sqlite3 \
php-tidy \
php-xmlrpc \
php-xml \
php-mbstring \
# php-gettext \
php-apcu \
php-common \
php-json \
php-readline \
php-enchant \
php-ssh2 \
php-oauth \
php-gmagick \
php-gnupg \
php-redis \
php-smbclient \
php-yaml \
php-geoip \
sendmail && \
phpenmod \
snmp \
gmp \
calendar \
ldap \
curl \
exif \
ftp \
fileinfo \
gd \
geoip \
# gettext \
gnupg \
iconv \
imap \
json \
mbstring \
memcached \
mysqli \
mysqlnd \
oauth \
pdo_mysql \
pdo_sqlite \
phar \
posix \
readline \
redis \
simplexml \
sockets \
sqlite3 \
ssh2 \
tokenizer \
xml \
xmlreader \
xmlrpc \
xmlwriter \
xsl \
yaml && \
a2enmod \
php7.4 \
rewrite \
ldap \
heartmonitor \
auth_basic \
authnz_ldap \
headers \
heartbeat \
lua \
mime \
status \
xml2enc \
xforward \
remoteip \
filter \
dav \
dav_fs \
alias && \
ln -sf /etc/ssl/dhparam.pem /etc/apache2/dhparam.pem && \
php -v
##################################################################
# Installing IOnCube addon
##################################################################
ADD https://www.ioncube.com/php-7.4.0-beta-loaders/ioncube_loaders_lin_x86-64_7.4_BETA2.tar.gz /tmp/ioncube.tar.gz
RUN tar -C /tmp -xvf /tmp/ioncube.tar.gz && \
cp /tmp/ioncube_loader_lin_7.4_10.4.0_beta2.so /usr/lib/php/20170718/ && \
echo "zend_extension = /usr/lib/php/20170718/ioncube_loader_lin_7.4_10.4.0_beta2.so" >> /etc/php/7.4/apache2/php.ini && \
echo "zend_extension = /usr/lib/php/20170718/ioncube_loader_lin_7.4_10.4.0_beta2.so" >> /etc/php/7.4/cgi/php.ini && \
echo "zend_extension = /usr/lib/php/20170718/ioncube_loader_lin_7.4_10.4.0_beta2.so" >> /etc/php/7.4/cli/php.ini && \
echo "zend_extension = /usr/lib/php/20170718/ioncube_loader_lin_7.4_10.4.0_beta2.so" >> /etc/php/7.4/fpm/php.ini && \
php -v
##################################################################
# Installing Composer addon
##################################################################
RUN cd /tmp && \
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
php composer-setup.php --install-dir=/usr/local/bin --filename=composer && \
rm /tmp/composer-setup.php
##################################################################
# cleaninig up
##################################################################
RUN apt clean -y && \
apt autoclean -y && \
rm -rfv /var/lib/apt/lists/* && \
rm -rfv /var/cache/apt/archives/*.deb && \
rm -rfv /tmp/deb/* && \
rm -rfv /tmp/composer-setup.php && \
rm -rfv /tmp/ioncube_loader_lin_7.4_10.4.0_beta2.so && \
rm -rfv /tmp/ioncube.tar.gz
#volumes
VOLUME ["/var/www"]
# Add image configuration and scripts
COPY run.sh /run.sh
RUN chmod 755 /*.sh
# Configure application
EXPOSE 80
WORKDIR /var/www/
CMD ["/run.sh"]

4
websites/php7.4/Makefile Normal file
View File

@ -0,0 +1,4 @@
all: php
php:
docker build --compress -t epicmorg/websites:php7.4 .
docker push epicmorg/websites:php7.4

32
websites/php7.4/README.md Normal file
View File

@ -0,0 +1,32 @@
# Compose example
```yml
version: '3.7'
services:
websites:
image: epicmorg/websites
# depends_on:
# - mysql
# - memcached
restart: unless-stopped
volumes:
- /etc/localtime:/etc/localtime
- /etc/timezone:/etc/timezone
# - /etc/letsencrypt:/etc/letsencrypt
- www:/var/www
- apache2:/etc/apache2
- php:/etc/php
restart: unless-stopped
# extra_hosts:
# - "example.com:192.168.0.11"
tmpfs:
- /tmp
- /var/lib/php/sessions
volumes:
www:
external: true
apache2:
external: true
php:
external: true
```

5
websites/php7.4/run.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
chown www-data:www-data /var/www -R
source /etc/apache2/envvars
tail -F /var/log/apache2/* &
exec apache2 -D FOREGROUND