From fe0b5cfd37789473503c2eb9ac3690c19b2a9cb3 Mon Sep 17 00:00:00 2001 From: Pavel Dmitriev Date: Tue, 23 Jun 2020 17:41:39 +0300 Subject: [PATCH] Initial commit --- 000-default.conf | 35 +++++++++++++++++++++++++++++++++++ Dockerfile | 22 ++++++++++++++++++++++ Dockerfile.debian | 17 +++++++++++++++++ apt-add-repos | 24 ++++++++++++++++++++++++ build.sh | 9 +++++++++ docker-entrypoint.sh | 4 ++++ last_version | 1 + localtime | Bin 0 -> 1518 bytes ondrej-ubuntu-php-focal.list | 2 ++ ondrej_ubuntu_php.gpg | Bin 0 -> 360 bytes timezone | 1 + 11 files changed, 115 insertions(+) create mode 100644 000-default.conf create mode 100644 Dockerfile create mode 100644 Dockerfile.debian create mode 100755 apt-add-repos create mode 100755 build.sh create mode 100755 docker-entrypoint.sh create mode 100644 last_version create mode 100644 localtime create mode 100644 ondrej-ubuntu-php-focal.list create mode 100644 ondrej_ubuntu_php.gpg create mode 100644 timezone diff --git a/000-default.conf b/000-default.conf new file mode 100644 index 0000000..e435af0 --- /dev/null +++ b/000-default.conf @@ -0,0 +1,35 @@ + + # The ServerName directive sets the request scheme, hostname and port that + # the server uses to identify itself. This is used when creating + # redirection URLs. In the context of virtual hosts, the ServerName + # specifies what hostname must appear in the request's Host: header to + # match this virtual host. For the default virtual host (this file) this + # value is not decisive as it is used as a last resort host regardless. + # However, you must set it for any further virtual host explicitly. + #ServerName www.example.com + + ServerAdmin webmaster@localhost + DocumentRoot /var/www/html + + + AllowOverride all + + + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular + # modules, e.g. + #LogLevel info ssl:warn + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + # For most configuration files from conf-available/, which are + # enabled or disabled at a global level, it is possible to + # include a line for only one particular virtual host. For example the + # following line enables the CGI configuration for this host only + # after it has been globally disabled with "a2disconf". + #Include conf-available/serve-cgi-bin.conf + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3c4cde5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM ubuntu:18.04 + +COPY ["timezone", "localtime", "/etc/"] + +RUN apt update -y \ + && apt-get install gnupg gnupg1 gnupg2 software-properties-common -y \ + && apt-add-repository ppa:ondrej/php \ + && apt-get update -y \ + && apt-get install apache2 php php-soap php-snmp php-mysql php-curl php-ldap php-xml php-mbstring php-oauth php-gd cron -y \ + && apt-get purge gnupg gnupg1 gnupg2 software-properties-common -y \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /var/www/html/* \ + && a2enmod rewrite + +COPY docker-entrypoint.sh / +COPY 000-default.conf /etc/apache2/sites-available +EXPOSE 80 +CMD ["/docker-entrypoint.sh"] + + + diff --git a/Dockerfile.debian b/Dockerfile.debian new file mode 100644 index 0000000..80660c1 --- /dev/null +++ b/Dockerfile.debian @@ -0,0 +1,17 @@ +FROM debian + + +RUN apt update -y \ + && apt-get install apache2 php php-soap php-snmp php-mysql php-curl php-ldap php-xml php-mbstring php-oauth php-gd cron -y \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /var/www/html/* \ + && a2enmod rewrite + +COPY docker-entrypoint.sh / +COPY 000-default.conf /etc/apache2/sites-available +EXPOSE 80 +CMD ["/docker-entrypoint.sh"] + + + diff --git a/apt-add-repos b/apt-add-repos new file mode 100755 index 0000000..2222a3c --- /dev/null +++ b/apt-add-repos @@ -0,0 +1,24 @@ +#!/bin/bash +if [ $# -eq 1 ] +NM=`uname -a && date` +NAME=`echo $NM | md5sum | cut -f1 -d" "` +then + ppa_name=`echo "$1" | cut -d":" -f2 -s` + if [ -z "$ppa_name" ] + then + echo "PPA name not found" + echo "Utility to add PPA repositories in your debian machine" + echo "$0 ppa:user/ppa-name" + else + echo "$ppa_name" + echo "deb http://ppa.launchpad.net/$ppa_name/ubuntu xenial main" >> /etc/apt/sources.list + apt-get update >> /dev/null 2> /tmp/${NAME}_apt_add_key.txt + key=`cat /tmp/${NAME}_apt_add_key.txt | cut -d":" -f6 | cut -d" " -f3` + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key + rm -rf /tmp/${NAME}_apt_add_key.txt + fi +else + echo "Utility to add PPA repositories in your debian machine" + echo "$0 ppa:user/ppa-name" +fi + diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..e2f028b --- /dev/null +++ b/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +build_version=`cat last_version` +(( build_version++ )) +echo $build_version; + +docker build --tag=mxfox.ru/chimera/fox-web-basic:${build_version} . +docker tag mxfox.ru/chimera/fox-web-basic:${build_version} mxfox.ru/chimera/fox-web-basic:latest +echo ${build_version} > last_version \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100755 index 0000000..9364c3a --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +service cron start +bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND" \ No newline at end of file diff --git a/last_version b/last_version new file mode 100644 index 0000000..9902f17 --- /dev/null +++ b/last_version @@ -0,0 +1 @@ +28 diff --git a/localtime b/localtime new file mode 100644 index 0000000000000000000000000000000000000000..aeb4321f9dc1667e3c6fa183ee43d71ec8ffadcf GIT binary patch literal 1518 zcma)*OGs2v7=Z6}93SH&TbNEc_AoWI$EZD=@-d~Om`+Ge1y&Rll3;YGpn?`dNNp;J zf)PioJ( z!#elaUOn^B4n3=Lou0j^Ue9S>rt>Q2>ACaWIzPvy3sOGoLT8~W{E)5Yy~zp}9k?GZ zdOog-AHGv1H%HX`$Wyi8^gXq(>xNpiuSa=zoK&To2Xxt_0qD9 zdg+&Kx?;uwRq?V;`#!g+<#!A8is4FC*;lKo?&PZKBl)W4tflbm^LDp31M*E_GNhP(&5VeFA^bVPLHvnzV_>m$19`f=U-1zS$RHwks#zh%gUK$x&J&b_S&9_^9uj(=lR=UFk}T=W!Lf2S|_{7D)BC{0)dchIb_-9#Ww5L zJ%g;!zjcyN#eXtu&Cj{uo2>P>qk|B&AbLR*GZf7rszG#vC}$|zLDVx8{U8b&iiQvs zAv*FYP!gggL`_4{6QU?YQ;4b%T_MUsw1ub((HEjHL}Q4`5S<}PL$rpd4bj_B6o+UI zQQc5?BnZh6lA`U1bHvAyVp3v4vIJ=^ zS4zy4nig{t`^Mxs-8Ipo6e%rAky4=)DYF!rYAO`tr7EdV>XccEloq8(=`Z$Nikv-h dE=B%&o@bgV^1rJ5E6X1Te0fpO(qj$Hr% literal 0 HcmV?d00001 diff --git a/ondrej-ubuntu-php-focal.list b/ondrej-ubuntu-php-focal.list new file mode 100644 index 0000000..a5b9191 --- /dev/null +++ b/ondrej-ubuntu-php-focal.list @@ -0,0 +1,2 @@ +deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main +# deb-src http://ppa.launchpad.net/ondrej/php/ubuntu focal main diff --git a/ondrej_ubuntu_php.gpg b/ondrej_ubuntu_php.gpg new file mode 100644 index 0000000000000000000000000000000000000000..82ef42b08cd94b2944e73af8c16fad296ad9a8a2 GIT binary patch literal 360 zcmV-u0hj)mjRZ-3`J4d+0J4J#K-FIPmiB*>|Lw-qIn$%n}5`Po1Hf*FNak#Awd|4UVGNDlnmns{I%0={+EnmwAK-9N=MgOdZaJMeU`N6ls? zm-dLl=KY)D^VV#b{j4GeZUGpY9*-r)gwihAieAGv7Q$7Q>oR)*-vAK-00FcgOks6y zV`y+;WFSybK_F&tav)D`WW||fY9Lc}a>KodwgeLa0stTd0!e-OoB|sI1`7!Y2Ll2G z6#@tY1Qr4V0RkQY0vCV)3JDNTPN1sgCVFf_HUs`OwKh@(0#y1E@pi@aTapnGiZ4uR znA%drtfPg?2uYcAL6_%&kkeZ)UV7rc3Elolp(^~b3aE`NHa~Rcitxg}{jkXDYMm-! zyj`>QzQ=6F7@ssRh9C2=XfyAhRPtaRx!z1NuHc3iF((SQnN7r0yJ`VLDkV7(<@gze G;5f_TDWV?$ literal 0 HcmV?d00001 diff --git a/timezone b/timezone new file mode 100644 index 0000000..94394e5 --- /dev/null +++ b/timezone @@ -0,0 +1 @@ +Europe/Moscow