diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..187d362 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/images diff --git a/Dockerfile b/Dockerfile index 3c4cde5..4e64d83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,30 @@ FROM ubuntu:18.04 +ENV php_version=7.4 + 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 install -y apache2 \ + php${php_version} \ + php${php_version}-soap \ + php${php_version}-snmp \ + php${php_version}-mysql \ + php${php_version}-curl \ + php${php_version}-ldap \ + php${php_version}-xml \ + php${php_version}-mbstring \ + php${php_version}-oauth \ + php${php_version}-gd \ + php${php_version}-igbinary \ + php${php_version}-memcached \ + php${php_version}-msgpack \ + php${php_version}-oauth \ + php${php_version}-zip \ + cron \ && apt-get purge gnupg gnupg1 gnupg2 software-properties-common -y \ && apt-get autoremove -y \ && rm -rf /var/lib/apt/lists/* \ @@ -15,6 +33,7 @@ RUN apt update -y \ COPY docker-entrypoint.sh / COPY 000-default.conf /etc/apache2/sites-available +WORKDIR /var/www/hmtl EXPOSE 80 CMD ["/docker-entrypoint.sh"] diff --git a/Dockerfile.debian b/Dockerfile.debian deleted file mode 100644 index 80660c1..0000000 --- a/Dockerfile.debian +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100755 index 2222a3c..0000000 --- a/apt-add-repos +++ /dev/null @@ -1,24 +0,0 @@ -#!/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 b/build new file mode 100755 index 0000000..8504bca --- /dev/null +++ b/build @@ -0,0 +1,54 @@ +#!/bin/bash + +build_name='fox-web-basic' +build_repos='mxfox.ru/chimera' +branch='latest' + +while getopts "b:dph" opt; do + case $opt in + d) DRY=1;; + p) PUSH=1;; + b) branch="${OPTARG}";; + h) echo "Usage: +# -d - dry-run (only prepare, not build) +# -p - push (build, tag but no push. +# -b - branch +# -t - target +";exit;; + esac +done + +if [ ! -f last_version ] +then + if [ ! -f init_version ] + then + echo "init_version not found!" + exit + fi + cp init_version last_version +fi + +build_version=`cat last_version` + +(( build_version++ )) +echo "Building image ${build_name}:$branch-$build_version"; + +if [ -n "$DRY" ] +then + echo DRY-RUN Selected. Build disabled + exit; +fi + +push_suffix='--output=type=local,dest=./images' + +if [ -n "$PUSH" ] +then + push_suffix='--push' +fi + +(( build_version++ )) + +docker buildx build --platform linux/arm,linux/arm64,linux/amd64 --tag=${build_repos}/${build_name}:${build_version} --tag ${build_repos}/${build_name}:latest . ${push_suffix} + +echo ${build_version} > last_version + diff --git a/build.sh b/build.sh deleted file mode 100755 index e2f028b..0000000 --- a/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/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/last_version b/last_version index 9902f17..b047711 100644 --- a/last_version +++ b/last_version @@ -1 +1 @@ -28 +100050 diff --git a/ondrej-ubuntu-php-focal.list b/ondrej-ubuntu-php-focal.list deleted file mode 100644 index a5b9191..0000000 --- a/ondrej-ubuntu-php-focal.list +++ /dev/null @@ -1,2 +0,0 @@ -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 deleted file mode 100644 index 82ef42b..0000000 Binary files a/ondrej_ubuntu_php.gpg and /dev/null differ