diff --git a/.github/workflows/hooks.yml b/.github/workflows/hooks.yml index 1437a9d9..03740c0e 100644 --- a/.github/workflows/hooks.yml +++ b/.github/workflows/hooks.yml @@ -15,17 +15,22 @@ jobs: matrix: version: ['10.0', '11.0', '12.0', '13.0'] php: ['7.3'] - archi: ['amd64'] variant: ['apache', 'fpm', 'fpm-alpine'] steps: - name: Check Out Repo uses: actions/checkout@v2 + - name: Setup QEMU + uses: docker/setup-qemu-action@v1 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Execute CI hooks id: docker_hooks run: | - cd images/${{ matrix.version }}/php${{ matrix.php }}-${{ matrix.variant }}-${{ matrix.archi }} + cd images/${{ matrix.version }}/php${{ matrix.php }}-${{ matrix.variant }} ./hooks/run - name: Display docker images diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 00000000..9539277d --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,43 @@ + +name: Docker Image Push + +on: + workflow_dispatch: + inputs: + version: + description: 'Image version to push (only specify one)' + required: true + default: '14.0' + platform: + description: 'Comma-separated list of platforms' + required: true + default: 'linux/arm/v7,linux/arm64,linux/386,linux/amd64' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + php: ['7.3'] + variant: ['apache', 'fpm', 'fpm-alpine'] + + steps: + - name: Checkout Repo + uses: actions/checkout@v2 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v1 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v1 + + - name: Execute push hook + id: docker_push_hook + env: + DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} + DOCKER_PLATFORM: ${{ github.event.inputs.platform }} + run: | + cd images/${{ github.event.inputs.version }}/php${{ matrix.php }}-${{ matrix.variant }} + ./hooks/run_push diff --git a/.travis.yml b/.travis.yml index 41bbd673..9ac21e24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ branches: before_install: - env | sort - export home=$(pwd) - - export travis_dir="${home}/images/${VERSION}/php${PHP_VERSION}-${VARIANT}-${ARCHI}" - - export TAG=${VERSION}-php${PHP_VERSION}-${VARIANT}-${ARCHI} + - export travis_dir="${home}/images/${VERSION}/php${PHP_VERSION}-${VARIANT}" + - export TAG=${VERSION}-php${PHP_VERSION}-${VARIANT} - export VCS_REF=`git rev-parse --short HEAD` - export BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` - export IMAGE_NAME=monogramm/docker-dolibarr:${TAG} @@ -63,47 +63,26 @@ matrix: # # Ref: https://docs.travis-ci.com/user/reference/osx # osx_image: xcode11.3 allow_failures: - - env: VERSION=develop PHP_VERSION=7.2 VARIANT=fpm-alpine ARCHI=i386 - - env: VERSION=develop PHP_VERSION=7.2 VARIANT=fpm-alpine ARCHI=amd64 - - env: VERSION=develop PHP_VERSION=7.2 VARIANT=fpm ARCHI=i386 - - env: VERSION=develop PHP_VERSION=7.2 VARIANT=fpm ARCHI=amd64 - - env: VERSION=develop PHP_VERSION=7.2 VARIANT=apache ARCHI=i386 - - env: VERSION=develop PHP_VERSION=7.2 VARIANT=apache ARCHI=amd64 + - env: VERSION=develop PHP_VERSION=7.2 VARIANT=fpm-alpine + - env: VERSION=develop PHP_VERSION=7.2 VARIANT=fpm + - env: VERSION=develop PHP_VERSION=7.2 VARIANT=apache env: # Environments - - VERSION=develop PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=i386 - - VERSION=develop PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=amd64 - - VERSION=develop PHP_VERSION=7.3 VARIANT=fpm ARCHI=i386 - - VERSION=develop PHP_VERSION=7.3 VARIANT=fpm ARCHI=amd64 - - VERSION=develop PHP_VERSION=7.3 VARIANT=apache ARCHI=i386 - - VERSION=develop PHP_VERSION=7.3 VARIANT=apache ARCHI=amd64 - - VERSION=10.0 PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=i386 - - VERSION=10.0 PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=amd64 - - VERSION=10.0 PHP_VERSION=7.3 VARIANT=fpm ARCHI=i386 - - VERSION=10.0 PHP_VERSION=7.3 VARIANT=fpm ARCHI=amd64 - - VERSION=10.0 PHP_VERSION=7.3 VARIANT=apache ARCHI=i386 - - VERSION=10.0 PHP_VERSION=7.3 VARIANT=apache ARCHI=amd64 - - VERSION=11.0 PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=i386 - - VERSION=11.0 PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=amd64 - - VERSION=11.0 PHP_VERSION=7.3 VARIANT=fpm ARCHI=i386 - - VERSION=11.0 PHP_VERSION=7.3 VARIANT=fpm ARCHI=amd64 - - VERSION=11.0 PHP_VERSION=7.3 VARIANT=apache ARCHI=i386 - - VERSION=11.0 PHP_VERSION=7.3 VARIANT=apache ARCHI=amd64 - - VERSION=12.0 PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=i386 - - VERSION=12.0 PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=amd64 - - VERSION=12.0 PHP_VERSION=7.3 VARIANT=fpm ARCHI=i386 - - VERSION=12.0 PHP_VERSION=7.3 VARIANT=fpm ARCHI=amd64 - - VERSION=12.0 PHP_VERSION=7.3 VARIANT=apache ARCHI=i386 - - VERSION=12.0 PHP_VERSION=7.3 VARIANT=apache ARCHI=amd64 - - VERSION=13.0 PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=i386 - - VERSION=13.0 PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=amd64 - - VERSION=13.0 PHP_VERSION=7.3 VARIANT=fpm ARCHI=i386 - - VERSION=13.0 PHP_VERSION=7.3 VARIANT=fpm ARCHI=amd64 - - VERSION=13.0 PHP_VERSION=7.3 VARIANT=apache ARCHI=i386 - - VERSION=13.0 PHP_VERSION=7.3 VARIANT=apache ARCHI=amd64 - - VERSION=14.0 PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=i386 - - VERSION=14.0 PHP_VERSION=7.3 VARIANT=fpm-alpine ARCHI=amd64 - - VERSION=14.0 PHP_VERSION=7.3 VARIANT=fpm ARCHI=i386 - - VERSION=14.0 PHP_VERSION=7.3 VARIANT=fpm ARCHI=amd64 - - VERSION=14.0 PHP_VERSION=7.3 VARIANT=apache ARCHI=i386 - - VERSION=14.0 PHP_VERSION=7.3 VARIANT=apache ARCHI=amd64 + - VERSION=14.0 PHP_VERSION=7.3 VARIANT=apache + - VERSION=14.0 PHP_VERSION=7.3 VARIANT=fpm + - VERSION=14.0 PHP_VERSION=7.3 VARIANT=fpm-alpine + - VERSION=13.0 PHP_VERSION=7.3 VARIANT=apache + - VERSION=13.0 PHP_VERSION=7.3 VARIANT=fpm + - VERSION=13.0 PHP_VERSION=7.3 VARIANT=fpm-alpine + - VERSION=12.0 PHP_VERSION=7.3 VARIANT=apache + - VERSION=12.0 PHP_VERSION=7.3 VARIANT=fpm + - VERSION=12.0 PHP_VERSION=7.3 VARIANT=fpm-alpine + - VERSION=11.0 PHP_VERSION=7.3 VARIANT=apache + - VERSION=11.0 PHP_VERSION=7.3 VARIANT=fpm + - VERSION=11.0 PHP_VERSION=7.3 VARIANT=fpm-alpine + - VERSION=10.0 PHP_VERSION=7.3 VARIANT=apache + - VERSION=10.0 PHP_VERSION=7.3 VARIANT=fpm + - VERSION=10.0 PHP_VERSION=7.3 VARIANT=fpm-alpine + - VERSION=develop PHP_VERSION=7.3 VARIANT=apache + - VERSION=develop PHP_VERSION=7.3 VARIANT=fpm + - VERSION=develop PHP_VERSION=7.3 VARIANT=fpm-alpine diff --git a/images/10.0/php7.3-apache-amd64/Dockerfile b/images/10.0/php7.3-apache-amd64/Dockerfile deleted file mode 100644 index 17ad2938..00000000 --- a/images/10.0/php7.3-apache-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-apache - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=10.0.7 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/10.0/php7.3-apache-i386/.dockertags b/images/10.0/php7.3-apache-i386/.dockertags deleted file mode 100644 index f515daf6..00000000 --- a/images/10.0/php7.3-apache-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -10.0.7-apache 10.0-apache 10.0.7 10.0 diff --git a/images/10.0/php7.3-apache-amd64/.dockerignore b/images/10.0/php7.3-apache/.dockerignore similarity index 100% rename from images/10.0/php7.3-apache-amd64/.dockerignore rename to images/10.0/php7.3-apache/.dockerignore diff --git a/images/10.0/php7.3-apache-amd64/.dockertags b/images/10.0/php7.3-apache/.dockertags similarity index 100% rename from images/10.0/php7.3-apache-amd64/.dockertags rename to images/10.0/php7.3-apache/.dockertags diff --git a/images/10.0/php7.3-apache-amd64/.env b/images/10.0/php7.3-apache/.env similarity index 100% rename from images/10.0/php7.3-apache-amd64/.env rename to images/10.0/php7.3-apache/.env diff --git a/images/10.0/php7.3-apache-i386/Dockerfile b/images/10.0/php7.3-apache/Dockerfile similarity index 99% rename from images/10.0/php7.3-apache-i386/Dockerfile rename to images/10.0/php7.3-apache/Dockerfile index e8ba0e40..7f25785b 100644 --- a/images/10.0/php7.3-apache-i386/Dockerfile +++ b/images/10.0/php7.3-apache/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-apache +FROM php:7.3-apache # Install the packages we need # Install the PHP extensions we need diff --git a/images/11.0/php7.3-apache-amd64/docker-compose.test.yml b/images/10.0/php7.3-apache/docker-compose.test.yml similarity index 99% rename from images/11.0/php7.3-apache-amd64/docker-compose.test.yml rename to images/10.0/php7.3-apache/docker-compose.test.yml index d4728e02..ec96a5de 100644 --- a/images/11.0/php7.3-apache-amd64/docker-compose.test.yml +++ b/images/10.0/php7.3-apache/docker-compose.test.yml @@ -35,7 +35,6 @@ services: context: ./ dockerfile: Dockerfile args: - - TAG=${TAG} - VCS_REF=${VCS_REF} - BUILD_DATE=${BUILD_DATE} image: ${IMAGE_NAME} diff --git a/images/10.0/php7.3-apache-amd64/entrypoint.sh b/images/10.0/php7.3-apache/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-apache-amd64/entrypoint.sh rename to images/10.0/php7.3-apache/entrypoint.sh diff --git a/images/10.0/php7.3-apache-amd64/hooks/README.md b/images/10.0/php7.3-apache/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/10.0/php7.3-apache-amd64/hooks/README.md rename to images/10.0/php7.3-apache/hooks/README.md diff --git a/images/10.0/php7.3-fpm-alpine-amd64/hooks/build b/images/10.0/php7.3-apache/hooks/build similarity index 85% rename from images/10.0/php7.3-fpm-alpine-amd64/hooks/build rename to images/10.0/php7.3-apache/hooks/build index d2369475..94a32e8f 100755 --- a/images/10.0/php7.3-fpm-alpine-amd64/hooks/build +++ b/images/10.0/php7.3-apache/hooks/build @@ -4,9 +4,9 @@ # https://docs.docker.com/docker-hub/builds/advanced/ # https://microbadger.com/labels -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ +docker buildx build \ --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ -f "$DOCKERFILE_PATH" \ -t "$IMAGE_NAME" . diff --git a/images/10.0/php7.3-fpm-alpine-amd64/hooks/post_push b/images/10.0/php7.3-apache/hooks/post_push similarity index 53% rename from images/10.0/php7.3-fpm-alpine-amd64/hooks/post_push rename to images/10.0/php7.3-apache/hooks/post_push index b0aa55b0..3223a1ce 100755 --- a/images/10.0/php7.3-fpm-alpine-amd64/hooks/post_push +++ b/images/10.0/php7.3-apache/hooks/post_push @@ -6,8 +6,13 @@ if [ -f ./.dockertags ]; then for tag in $(cat ./.dockertags); do if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . fi done fi diff --git a/images/10.0/php7.3-apache-amd64/hooks/post_test b/images/10.0/php7.3-apache/hooks/post_test similarity index 100% rename from images/10.0/php7.3-apache-amd64/hooks/post_test rename to images/10.0/php7.3-apache/hooks/post_test diff --git a/images/10.0/php7.3-apache-amd64/hooks/pre_push b/images/10.0/php7.3-apache/hooks/pre_push similarity index 62% rename from images/10.0/php7.3-apache-amd64/hooks/pre_push rename to images/10.0/php7.3-apache/hooks/pre_push index 33d1f879..e9bb0c60 100755 --- a/images/10.0/php7.3-apache-amd64/hooks/pre_push +++ b/images/10.0/php7.3-apache/hooks/pre_push @@ -4,5 +4,5 @@ # https://docs.docker.com/docker-hub/builds/advanced/ if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" fi diff --git a/images/10.0/php7.3-fpm-alpine-amd64/hooks/pre_test b/images/10.0/php7.3-apache/hooks/pre_test similarity index 78% rename from images/10.0/php7.3-fpm-alpine-amd64/hooks/pre_test rename to images/10.0/php7.3-apache/hooks/pre_test index a7936aa9..0bbb213e 100755 --- a/images/10.0/php7.3-fpm-alpine-amd64/hooks/pre_test +++ b/images/10.0/php7.3-apache/hooks/pre_test @@ -10,6 +10,9 @@ if [ ! -f '.env' ]; then mv .env.tmp .env fi +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + #echo 'Preparing persisted data...' #mkdir -p "${APP_HOME:-/srv/dolibarr}" #chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/10.0/php7.3-apache-amd64/hooks/run b/images/10.0/php7.3-apache/hooks/run similarity index 100% rename from images/10.0/php7.3-apache-amd64/hooks/run rename to images/10.0/php7.3-apache/hooks/run diff --git a/images/10.0/php7.3-fpm-alpine-i386/hooks/run b/images/10.0/php7.3-apache/hooks/run_push similarity index 92% rename from images/10.0/php7.3-fpm-alpine-i386/hooks/run rename to images/10.0/php7.3-apache/hooks/run_push index 55bff982..c2c86d31 100755 --- a/images/10.0/php7.3-fpm-alpine-i386/hooks/run +++ b/images/10.0/php7.3-apache/hooks/run_push @@ -16,11 +16,11 @@ COMMIT_MSG=$(git log -1 --format=%s) export DOCKER_REPO=monogramm/docker-dolibarr export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=10.0 +export DOCKER_TAG=${VARIANT} export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} # Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" +IFS=',' read -ra STEPS <<< "${1:-push}" for step in "${STEPS[@]}" do for hook in "pre_${step}" "${step}" "post_${step}"; do diff --git a/images/10.0/php7.3-apache-amd64/hooks/test b/images/10.0/php7.3-apache/hooks/test similarity index 100% rename from images/10.0/php7.3-apache-amd64/hooks/test rename to images/10.0/php7.3-apache/hooks/test diff --git a/images/10.0/php7.3-apache-amd64/test/Dockerfile b/images/10.0/php7.3-apache/test/Dockerfile similarity index 100% rename from images/10.0/php7.3-apache-amd64/test/Dockerfile rename to images/10.0/php7.3-apache/test/Dockerfile diff --git a/images/10.0/php7.3-apache-amd64/test/docker_test.sh b/images/10.0/php7.3-apache/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-apache-amd64/test/docker_test.sh rename to images/10.0/php7.3-apache/test/docker_test.sh diff --git a/images/10.0/php7.3-fpm-alpine-amd64/Dockerfile b/images/10.0/php7.3-fpm-alpine-amd64/Dockerfile deleted file mode 100644 index 9b5b2b57..00000000 --- a/images/10.0/php7.3-fpm-alpine-amd64/Dockerfile +++ /dev/null @@ -1,160 +0,0 @@ -FROM amd64/php:7.3-fpm-alpine - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apk add --no-cache \ - bzip2 \ - icu-libs \ - imagemagick \ - libldap \ - libpq \ - libpng \ - mysql-client \ - rsync \ - ssmtp \ - shadow \ - unzip \ - zip \ - ; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - curl-dev \ - freetype-dev \ - gcc \ - g++ \ - icu-dev \ - libjpeg-turbo-dev \ - imagemagick-dev \ - imagemagick-libs \ - libmcrypt-dev \ - libpng-dev \ - libtool \ - libxml2-dev \ - libzip-dev \ - make \ - openldap-dev \ - postgresql-dev \ - postgresql-libs \ - unzip \ - zlib-dev \ - ; \ - docker-php-ext-configure ldap; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - apk --purge del .build-deps; \ - rm -rf /var/cache/apk/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=82 \ - WWW_GROUP_ID=82 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=10.0.7 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=${DOLI_VERSION} \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/10.0/php7.3-fpm-alpine-i386/.dockertags b/images/10.0/php7.3-fpm-alpine-i386/.dockertags deleted file mode 100644 index 2279b7fd..00000000 --- a/images/10.0/php7.3-fpm-alpine-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -10.0.7-fpm-alpine 10.0-fpm-alpine diff --git a/images/10.0/php7.3-apache-i386/.dockerignore b/images/10.0/php7.3-fpm-alpine/.dockerignore similarity index 100% rename from images/10.0/php7.3-apache-i386/.dockerignore rename to images/10.0/php7.3-fpm-alpine/.dockerignore diff --git a/images/10.0/php7.3-fpm-alpine-amd64/.dockertags b/images/10.0/php7.3-fpm-alpine/.dockertags similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/.dockertags rename to images/10.0/php7.3-fpm-alpine/.dockertags diff --git a/images/10.0/php7.3-apache-i386/.env b/images/10.0/php7.3-fpm-alpine/.env similarity index 100% rename from images/10.0/php7.3-apache-i386/.env rename to images/10.0/php7.3-fpm-alpine/.env diff --git a/images/10.0/php7.3-fpm-alpine-i386/Dockerfile b/images/10.0/php7.3-fpm-alpine/Dockerfile similarity index 99% rename from images/10.0/php7.3-fpm-alpine-i386/Dockerfile rename to images/10.0/php7.3-fpm-alpine/Dockerfile index 0625a1ca..93d943d9 100644 --- a/images/10.0/php7.3-fpm-alpine-i386/Dockerfile +++ b/images/10.0/php7.3-fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-fpm-alpine +FROM php:7.3-fpm-alpine # Install the packages we need # Install the PHP extensions we need diff --git a/images/10.0/php7.3-fpm-alpine-i386/docker-compose.test.yml b/images/10.0/php7.3-fpm-alpine/docker-compose.test.yml similarity index 99% rename from images/10.0/php7.3-fpm-alpine-i386/docker-compose.test.yml rename to images/10.0/php7.3-fpm-alpine/docker-compose.test.yml index 428bbae2..9e035418 100644 --- a/images/10.0/php7.3-fpm-alpine-i386/docker-compose.test.yml +++ b/images/10.0/php7.3-fpm-alpine/docker-compose.test.yml @@ -35,7 +35,6 @@ services: context: ./ dockerfile: Dockerfile args: - - TAG=${TAG} - VCS_REF=${VCS_REF} - BUILD_DATE=${BUILD_DATE} image: ${IMAGE_NAME} diff --git a/images/10.0/php7.3-apache-i386/entrypoint.sh b/images/10.0/php7.3-fpm-alpine/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-apache-i386/entrypoint.sh rename to images/10.0/php7.3-fpm-alpine/entrypoint.sh diff --git a/images/10.0/php7.3-apache-i386/hooks/README.md b/images/10.0/php7.3-fpm-alpine/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/10.0/php7.3-apache-i386/hooks/README.md rename to images/10.0/php7.3-fpm-alpine/hooks/README.md diff --git a/images/10.0/php7.3-fpm-alpine-i386/hooks/build b/images/10.0/php7.3-fpm-alpine/hooks/build similarity index 85% rename from images/10.0/php7.3-fpm-alpine-i386/hooks/build rename to images/10.0/php7.3-fpm-alpine/hooks/build index d2369475..94a32e8f 100755 --- a/images/10.0/php7.3-fpm-alpine-i386/hooks/build +++ b/images/10.0/php7.3-fpm-alpine/hooks/build @@ -4,9 +4,9 @@ # https://docs.docker.com/docker-hub/builds/advanced/ # https://microbadger.com/labels -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ +docker buildx build \ --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ -f "$DOCKERFILE_PATH" \ -t "$IMAGE_NAME" . diff --git a/images/10.0/php7.3-apache-i386/hooks/post_push b/images/10.0/php7.3-fpm-alpine/hooks/post_push similarity index 53% rename from images/10.0/php7.3-apache-i386/hooks/post_push rename to images/10.0/php7.3-fpm-alpine/hooks/post_push index b0aa55b0..3223a1ce 100755 --- a/images/10.0/php7.3-apache-i386/hooks/post_push +++ b/images/10.0/php7.3-fpm-alpine/hooks/post_push @@ -6,8 +6,13 @@ if [ -f ./.dockertags ]; then for tag in $(cat ./.dockertags); do if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . fi done fi diff --git a/images/10.0/php7.3-apache-i386/hooks/post_test b/images/10.0/php7.3-fpm-alpine/hooks/post_test similarity index 100% rename from images/10.0/php7.3-apache-i386/hooks/post_test rename to images/10.0/php7.3-fpm-alpine/hooks/post_test diff --git a/images/10.0/php7.3-apache-i386/hooks/pre_push b/images/10.0/php7.3-fpm-alpine/hooks/pre_push similarity index 62% rename from images/10.0/php7.3-apache-i386/hooks/pre_push rename to images/10.0/php7.3-fpm-alpine/hooks/pre_push index 33d1f879..e9bb0c60 100755 --- a/images/10.0/php7.3-apache-i386/hooks/pre_push +++ b/images/10.0/php7.3-fpm-alpine/hooks/pre_push @@ -4,5 +4,5 @@ # https://docs.docker.com/docker-hub/builds/advanced/ if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" fi diff --git a/images/10.0/php7.3-apache-amd64/hooks/pre_test b/images/10.0/php7.3-fpm-alpine/hooks/pre_test similarity index 78% rename from images/10.0/php7.3-apache-amd64/hooks/pre_test rename to images/10.0/php7.3-fpm-alpine/hooks/pre_test index a7936aa9..0bbb213e 100755 --- a/images/10.0/php7.3-apache-amd64/hooks/pre_test +++ b/images/10.0/php7.3-fpm-alpine/hooks/pre_test @@ -10,6 +10,9 @@ if [ ! -f '.env' ]; then mv .env.tmp .env fi +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + #echo 'Preparing persisted data...' #mkdir -p "${APP_HOME:-/srv/dolibarr}" #chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/10.0/php7.3-apache-i386/hooks/run b/images/10.0/php7.3-fpm-alpine/hooks/run similarity index 100% rename from images/10.0/php7.3-apache-i386/hooks/run rename to images/10.0/php7.3-fpm-alpine/hooks/run diff --git a/images/10.0/php7.3-fpm-amd64/hooks/run b/images/10.0/php7.3-fpm-alpine/hooks/run_push similarity index 92% rename from images/10.0/php7.3-fpm-amd64/hooks/run rename to images/10.0/php7.3-fpm-alpine/hooks/run_push index 55bff982..c2c86d31 100755 --- a/images/10.0/php7.3-fpm-amd64/hooks/run +++ b/images/10.0/php7.3-fpm-alpine/hooks/run_push @@ -16,11 +16,11 @@ COMMIT_MSG=$(git log -1 --format=%s) export DOCKER_REPO=monogramm/docker-dolibarr export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=10.0 +export DOCKER_TAG=${VARIANT} export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} # Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" +IFS=',' read -ra STEPS <<< "${1:-push}" for step in "${STEPS[@]}" do for hook in "pre_${step}" "${step}" "post_${step}"; do diff --git a/images/10.0/php7.3-apache-i386/hooks/test b/images/10.0/php7.3-fpm-alpine/hooks/test similarity index 100% rename from images/10.0/php7.3-apache-i386/hooks/test rename to images/10.0/php7.3-fpm-alpine/hooks/test diff --git a/images/10.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template b/images/10.0/php7.3-fpm-alpine/nginx/templates/default.conf.template similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template rename to images/10.0/php7.3-fpm-alpine/nginx/templates/default.conf.template diff --git a/images/10.0/php7.3-apache-i386/test/Dockerfile b/images/10.0/php7.3-fpm-alpine/test/Dockerfile similarity index 100% rename from images/10.0/php7.3-apache-i386/test/Dockerfile rename to images/10.0/php7.3-fpm-alpine/test/Dockerfile diff --git a/images/10.0/php7.3-apache-i386/test/docker_test.sh b/images/10.0/php7.3-fpm-alpine/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-apache-i386/test/docker_test.sh rename to images/10.0/php7.3-fpm-alpine/test/docker_test.sh diff --git a/images/10.0/php7.3-fpm-amd64/Dockerfile b/images/10.0/php7.3-fpm-amd64/Dockerfile deleted file mode 100644 index 29a59895..00000000 --- a/images/10.0/php7.3-fpm-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-fpm - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=10.0.7 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/10.0/php7.3-fpm-amd64/hooks/build b/images/10.0/php7.3-fpm-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/10.0/php7.3-fpm-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/10.0/php7.3-fpm-amd64/hooks/post_push b/images/10.0/php7.3-fpm-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/10.0/php7.3-fpm-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/10.0/php7.3-fpm-amd64/hooks/pre_push b/images/10.0/php7.3-fpm-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/10.0/php7.3-fpm-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/10.0/php7.3-fpm-amd64/hooks/pre_test b/images/10.0/php7.3-fpm-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/10.0/php7.3-fpm-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/10.0/php7.3-fpm-i386/.dockertags b/images/10.0/php7.3-fpm-i386/.dockertags deleted file mode 100644 index 6e4513d1..00000000 --- a/images/10.0/php7.3-fpm-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -10.0.7-fpm 10.0-fpm diff --git a/images/10.0/php7.3-fpm-i386/hooks/build b/images/10.0/php7.3-fpm-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/10.0/php7.3-fpm-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/10.0/php7.3-fpm-i386/hooks/post_push b/images/10.0/php7.3-fpm-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/10.0/php7.3-fpm-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/10.0/php7.3-fpm-i386/hooks/pre_push b/images/10.0/php7.3-fpm-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/10.0/php7.3-fpm-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/10.0/php7.3-fpm-i386/hooks/pre_test b/images/10.0/php7.3-fpm-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/10.0/php7.3-fpm-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/10.0/php7.3-fpm-alpine-amd64/.dockerignore b/images/10.0/php7.3-fpm/.dockerignore similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/.dockerignore rename to images/10.0/php7.3-fpm/.dockerignore diff --git a/images/10.0/php7.3-fpm-amd64/.dockertags b/images/10.0/php7.3-fpm/.dockertags similarity index 100% rename from images/10.0/php7.3-fpm-amd64/.dockertags rename to images/10.0/php7.3-fpm/.dockertags diff --git a/images/10.0/php7.3-fpm-alpine-amd64/.env b/images/10.0/php7.3-fpm/.env similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/.env rename to images/10.0/php7.3-fpm/.env diff --git a/images/10.0/php7.3-fpm-i386/Dockerfile b/images/10.0/php7.3-fpm/Dockerfile similarity index 99% rename from images/10.0/php7.3-fpm-i386/Dockerfile rename to images/10.0/php7.3-fpm/Dockerfile index 7e231afb..a723fb60 100644 --- a/images/10.0/php7.3-fpm-i386/Dockerfile +++ b/images/10.0/php7.3-fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-fpm +FROM php:7.3-fpm # Install the packages we need # Install the PHP extensions we need diff --git a/images/10.0/php7.3-fpm-amd64/docker-compose.test.yml b/images/10.0/php7.3-fpm/docker-compose.test.yml similarity index 99% rename from images/10.0/php7.3-fpm-amd64/docker-compose.test.yml rename to images/10.0/php7.3-fpm/docker-compose.test.yml index 428bbae2..9e035418 100644 --- a/images/10.0/php7.3-fpm-amd64/docker-compose.test.yml +++ b/images/10.0/php7.3-fpm/docker-compose.test.yml @@ -35,7 +35,6 @@ services: context: ./ dockerfile: Dockerfile args: - - TAG=${TAG} - VCS_REF=${VCS_REF} - BUILD_DATE=${BUILD_DATE} image: ${IMAGE_NAME} diff --git a/images/10.0/php7.3-fpm-alpine-amd64/entrypoint.sh b/images/10.0/php7.3-fpm/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/entrypoint.sh rename to images/10.0/php7.3-fpm/entrypoint.sh diff --git a/images/10.0/php7.3-fpm-alpine-amd64/hooks/README.md b/images/10.0/php7.3-fpm/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/hooks/README.md rename to images/10.0/php7.3-fpm/hooks/README.md diff --git a/images/10.0/php7.3-apache-amd64/hooks/build b/images/10.0/php7.3-fpm/hooks/build similarity index 85% rename from images/10.0/php7.3-apache-amd64/hooks/build rename to images/10.0/php7.3-fpm/hooks/build index d2369475..94a32e8f 100755 --- a/images/10.0/php7.3-apache-amd64/hooks/build +++ b/images/10.0/php7.3-fpm/hooks/build @@ -4,9 +4,9 @@ # https://docs.docker.com/docker-hub/builds/advanced/ # https://microbadger.com/labels -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ +docker buildx build \ --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ -f "$DOCKERFILE_PATH" \ -t "$IMAGE_NAME" . diff --git a/images/10.0/php7.3-fpm-alpine-i386/hooks/post_push b/images/10.0/php7.3-fpm/hooks/post_push similarity index 53% rename from images/10.0/php7.3-fpm-alpine-i386/hooks/post_push rename to images/10.0/php7.3-fpm/hooks/post_push index b0aa55b0..3223a1ce 100755 --- a/images/10.0/php7.3-fpm-alpine-i386/hooks/post_push +++ b/images/10.0/php7.3-fpm/hooks/post_push @@ -6,8 +6,13 @@ if [ -f ./.dockertags ]; then for tag in $(cat ./.dockertags); do if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . fi done fi diff --git a/images/10.0/php7.3-fpm-alpine-amd64/hooks/post_test b/images/10.0/php7.3-fpm/hooks/post_test similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/hooks/post_test rename to images/10.0/php7.3-fpm/hooks/post_test diff --git a/images/10.0/php7.3-fpm-alpine-amd64/hooks/pre_push b/images/10.0/php7.3-fpm/hooks/pre_push similarity index 62% rename from images/10.0/php7.3-fpm-alpine-amd64/hooks/pre_push rename to images/10.0/php7.3-fpm/hooks/pre_push index 33d1f879..e9bb0c60 100755 --- a/images/10.0/php7.3-fpm-alpine-amd64/hooks/pre_push +++ b/images/10.0/php7.3-fpm/hooks/pre_push @@ -4,5 +4,5 @@ # https://docs.docker.com/docker-hub/builds/advanced/ if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" fi diff --git a/images/10.0/php7.3-fpm-alpine-i386/hooks/pre_test b/images/10.0/php7.3-fpm/hooks/pre_test similarity index 78% rename from images/10.0/php7.3-fpm-alpine-i386/hooks/pre_test rename to images/10.0/php7.3-fpm/hooks/pre_test index a7936aa9..0bbb213e 100755 --- a/images/10.0/php7.3-fpm-alpine-i386/hooks/pre_test +++ b/images/10.0/php7.3-fpm/hooks/pre_test @@ -10,6 +10,9 @@ if [ ! -f '.env' ]; then mv .env.tmp .env fi +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + #echo 'Preparing persisted data...' #mkdir -p "${APP_HOME:-/srv/dolibarr}" #chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/10.0/php7.3-fpm-alpine-amd64/hooks/run b/images/10.0/php7.3-fpm/hooks/run similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/hooks/run rename to images/10.0/php7.3-fpm/hooks/run diff --git a/images/10.0/php7.3-fpm-i386/hooks/run b/images/10.0/php7.3-fpm/hooks/run_push similarity index 92% rename from images/10.0/php7.3-fpm-i386/hooks/run rename to images/10.0/php7.3-fpm/hooks/run_push index 55bff982..c2c86d31 100755 --- a/images/10.0/php7.3-fpm-i386/hooks/run +++ b/images/10.0/php7.3-fpm/hooks/run_push @@ -16,11 +16,11 @@ COMMIT_MSG=$(git log -1 --format=%s) export DOCKER_REPO=monogramm/docker-dolibarr export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=10.0 +export DOCKER_TAG=${VARIANT} export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} # Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" +IFS=',' read -ra STEPS <<< "${1:-push}" for step in "${STEPS[@]}" do for hook in "pre_${step}" "${step}" "post_${step}"; do diff --git a/images/10.0/php7.3-fpm-alpine-amd64/hooks/test b/images/10.0/php7.3-fpm/hooks/test similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/hooks/test rename to images/10.0/php7.3-fpm/hooks/test diff --git a/images/10.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template b/images/10.0/php7.3-fpm/nginx/templates/default.conf.template similarity index 100% rename from images/10.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template rename to images/10.0/php7.3-fpm/nginx/templates/default.conf.template diff --git a/images/10.0/php7.3-fpm-alpine-amd64/test/Dockerfile b/images/10.0/php7.3-fpm/test/Dockerfile similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/test/Dockerfile rename to images/10.0/php7.3-fpm/test/Dockerfile diff --git a/images/10.0/php7.3-fpm-alpine-amd64/test/docker_test.sh b/images/10.0/php7.3-fpm/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-fpm-alpine-amd64/test/docker_test.sh rename to images/10.0/php7.3-fpm/test/docker_test.sh diff --git a/images/11.0/php7.3-apache-amd64/Dockerfile b/images/11.0/php7.3-apache-amd64/Dockerfile deleted file mode 100644 index be58e77e..00000000 --- a/images/11.0/php7.3-apache-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-apache - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=11.0.5 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/11.0/php7.3-apache-amd64/hooks/build b/images/11.0/php7.3-apache-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/11.0/php7.3-apache-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/11.0/php7.3-apache-amd64/hooks/post_push b/images/11.0/php7.3-apache-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/11.0/php7.3-apache-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-apache-amd64/hooks/pre_push b/images/11.0/php7.3-apache-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/11.0/php7.3-apache-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-apache-amd64/hooks/pre_test b/images/11.0/php7.3-apache-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/11.0/php7.3-apache-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/11.0/php7.3-apache-i386/.dockertags b/images/11.0/php7.3-apache-i386/.dockertags deleted file mode 100644 index 98fc235f..00000000 --- a/images/11.0/php7.3-apache-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -11.0.5-apache 11.0-apache 11.0.5 11.0 diff --git a/images/11.0/php7.3-apache-i386/hooks/build b/images/11.0/php7.3-apache-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/11.0/php7.3-apache-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/11.0/php7.3-apache-i386/hooks/post_push b/images/11.0/php7.3-apache-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/11.0/php7.3-apache-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-apache-i386/hooks/pre_push b/images/11.0/php7.3-apache-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/11.0/php7.3-apache-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-apache-i386/hooks/pre_test b/images/11.0/php7.3-apache-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/11.0/php7.3-apache-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/10.0/php7.3-fpm-alpine-i386/.dockerignore b/images/11.0/php7.3-apache/.dockerignore similarity index 100% rename from images/10.0/php7.3-fpm-alpine-i386/.dockerignore rename to images/11.0/php7.3-apache/.dockerignore diff --git a/images/11.0/php7.3-apache-amd64/.dockertags b/images/11.0/php7.3-apache/.dockertags similarity index 100% rename from images/11.0/php7.3-apache-amd64/.dockertags rename to images/11.0/php7.3-apache/.dockertags diff --git a/images/10.0/php7.3-fpm-alpine-i386/.env b/images/11.0/php7.3-apache/.env similarity index 100% rename from images/10.0/php7.3-fpm-alpine-i386/.env rename to images/11.0/php7.3-apache/.env diff --git a/images/11.0/php7.3-apache-i386/Dockerfile b/images/11.0/php7.3-apache/Dockerfile similarity index 99% rename from images/11.0/php7.3-apache-i386/Dockerfile rename to images/11.0/php7.3-apache/Dockerfile index 0cb61118..8e867938 100644 --- a/images/11.0/php7.3-apache-i386/Dockerfile +++ b/images/11.0/php7.3-apache/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-apache +FROM php:7.3-apache # Install the packages we need # Install the PHP extensions we need diff --git a/images/10.0/php7.3-apache-amd64/docker-compose.test.yml b/images/11.0/php7.3-apache/docker-compose.test.yml similarity index 99% rename from images/10.0/php7.3-apache-amd64/docker-compose.test.yml rename to images/11.0/php7.3-apache/docker-compose.test.yml index d4728e02..ec96a5de 100644 --- a/images/10.0/php7.3-apache-amd64/docker-compose.test.yml +++ b/images/11.0/php7.3-apache/docker-compose.test.yml @@ -35,7 +35,6 @@ services: context: ./ dockerfile: Dockerfile args: - - TAG=${TAG} - VCS_REF=${VCS_REF} - BUILD_DATE=${BUILD_DATE} image: ${IMAGE_NAME} diff --git a/images/10.0/php7.3-fpm-alpine-i386/entrypoint.sh b/images/11.0/php7.3-apache/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-fpm-alpine-i386/entrypoint.sh rename to images/11.0/php7.3-apache/entrypoint.sh diff --git a/images/10.0/php7.3-fpm-alpine-i386/hooks/README.md b/images/11.0/php7.3-apache/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/10.0/php7.3-fpm-alpine-i386/hooks/README.md rename to images/11.0/php7.3-apache/hooks/README.md diff --git a/images/10.0/php7.3-apache-i386/hooks/build b/images/11.0/php7.3-apache/hooks/build similarity index 85% rename from images/10.0/php7.3-apache-i386/hooks/build rename to images/11.0/php7.3-apache/hooks/build index d2369475..94a32e8f 100755 --- a/images/10.0/php7.3-apache-i386/hooks/build +++ b/images/11.0/php7.3-apache/hooks/build @@ -4,9 +4,9 @@ # https://docs.docker.com/docker-hub/builds/advanced/ # https://microbadger.com/labels -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ +docker buildx build \ --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ -f "$DOCKERFILE_PATH" \ -t "$IMAGE_NAME" . diff --git a/images/10.0/php7.3-apache-amd64/hooks/post_push b/images/11.0/php7.3-apache/hooks/post_push similarity index 53% rename from images/10.0/php7.3-apache-amd64/hooks/post_push rename to images/11.0/php7.3-apache/hooks/post_push index b0aa55b0..3223a1ce 100755 --- a/images/10.0/php7.3-apache-amd64/hooks/post_push +++ b/images/11.0/php7.3-apache/hooks/post_push @@ -6,8 +6,13 @@ if [ -f ./.dockertags ]; then for tag in $(cat ./.dockertags); do if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . fi done fi diff --git a/images/10.0/php7.3-fpm-alpine-i386/hooks/post_test b/images/11.0/php7.3-apache/hooks/post_test similarity index 100% rename from images/10.0/php7.3-fpm-alpine-i386/hooks/post_test rename to images/11.0/php7.3-apache/hooks/post_test diff --git a/images/10.0/php7.3-fpm-alpine-i386/hooks/pre_push b/images/11.0/php7.3-apache/hooks/pre_push similarity index 62% rename from images/10.0/php7.3-fpm-alpine-i386/hooks/pre_push rename to images/11.0/php7.3-apache/hooks/pre_push index 33d1f879..e9bb0c60 100755 --- a/images/10.0/php7.3-fpm-alpine-i386/hooks/pre_push +++ b/images/11.0/php7.3-apache/hooks/pre_push @@ -4,5 +4,5 @@ # https://docs.docker.com/docker-hub/builds/advanced/ if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" fi diff --git a/images/10.0/php7.3-apache-i386/hooks/pre_test b/images/11.0/php7.3-apache/hooks/pre_test similarity index 78% rename from images/10.0/php7.3-apache-i386/hooks/pre_test rename to images/11.0/php7.3-apache/hooks/pre_test index a7936aa9..0bbb213e 100755 --- a/images/10.0/php7.3-apache-i386/hooks/pre_test +++ b/images/11.0/php7.3-apache/hooks/pre_test @@ -10,6 +10,9 @@ if [ ! -f '.env' ]; then mv .env.tmp .env fi +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + #echo 'Preparing persisted data...' #mkdir -p "${APP_HOME:-/srv/dolibarr}" #chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/11.0/php7.3-apache-amd64/hooks/run b/images/11.0/php7.3-apache/hooks/run similarity index 100% rename from images/11.0/php7.3-apache-amd64/hooks/run rename to images/11.0/php7.3-apache/hooks/run diff --git a/images/11.0/php7.3-fpm-alpine-i386/hooks/run b/images/11.0/php7.3-apache/hooks/run_push similarity index 92% rename from images/11.0/php7.3-fpm-alpine-i386/hooks/run rename to images/11.0/php7.3-apache/hooks/run_push index bf5fb8d9..c2c86d31 100755 --- a/images/11.0/php7.3-fpm-alpine-i386/hooks/run +++ b/images/11.0/php7.3-apache/hooks/run_push @@ -16,11 +16,11 @@ COMMIT_MSG=$(git log -1 --format=%s) export DOCKER_REPO=monogramm/docker-dolibarr export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=11.0 +export DOCKER_TAG=${VARIANT} export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} # Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" +IFS=',' read -ra STEPS <<< "${1:-push}" for step in "${STEPS[@]}" do for hook in "pre_${step}" "${step}" "post_${step}"; do diff --git a/images/10.0/php7.3-fpm-alpine-i386/hooks/test b/images/11.0/php7.3-apache/hooks/test similarity index 100% rename from images/10.0/php7.3-fpm-alpine-i386/hooks/test rename to images/11.0/php7.3-apache/hooks/test diff --git a/images/10.0/php7.3-fpm-alpine-i386/test/Dockerfile b/images/11.0/php7.3-apache/test/Dockerfile similarity index 100% rename from images/10.0/php7.3-fpm-alpine-i386/test/Dockerfile rename to images/11.0/php7.3-apache/test/Dockerfile diff --git a/images/10.0/php7.3-fpm-alpine-i386/test/docker_test.sh b/images/11.0/php7.3-apache/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-fpm-alpine-i386/test/docker_test.sh rename to images/11.0/php7.3-apache/test/docker_test.sh diff --git a/images/11.0/php7.3-fpm-alpine-amd64/Dockerfile b/images/11.0/php7.3-fpm-alpine-amd64/Dockerfile deleted file mode 100644 index 4ad1d172..00000000 --- a/images/11.0/php7.3-fpm-alpine-amd64/Dockerfile +++ /dev/null @@ -1,160 +0,0 @@ -FROM amd64/php:7.3-fpm-alpine - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apk add --no-cache \ - bzip2 \ - icu-libs \ - imagemagick \ - libldap \ - libpq \ - libpng \ - mysql-client \ - rsync \ - ssmtp \ - shadow \ - unzip \ - zip \ - ; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - curl-dev \ - freetype-dev \ - gcc \ - g++ \ - icu-dev \ - libjpeg-turbo-dev \ - imagemagick-dev \ - imagemagick-libs \ - libmcrypt-dev \ - libpng-dev \ - libtool \ - libxml2-dev \ - libzip-dev \ - make \ - openldap-dev \ - postgresql-dev \ - postgresql-libs \ - unzip \ - zlib-dev \ - ; \ - docker-php-ext-configure ldap; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - apk --purge del .build-deps; \ - rm -rf /var/cache/apk/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=82 \ - WWW_GROUP_ID=82 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=11.0.5 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=${DOLI_VERSION} \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/11.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml b/images/11.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/11.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/11.0/php7.3-fpm-alpine-amd64/hooks/build b/images/11.0/php7.3-fpm-alpine-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/11.0/php7.3-fpm-alpine-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/11.0/php7.3-fpm-alpine-amd64/hooks/post_push b/images/11.0/php7.3-fpm-alpine-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/11.0/php7.3-fpm-alpine-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-fpm-alpine-amd64/hooks/pre_push b/images/11.0/php7.3-fpm-alpine-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/11.0/php7.3-fpm-alpine-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-fpm-alpine-amd64/hooks/pre_test b/images/11.0/php7.3-fpm-alpine-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/11.0/php7.3-fpm-alpine-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/11.0/php7.3-fpm-alpine-i386/.dockertags b/images/11.0/php7.3-fpm-alpine-i386/.dockertags deleted file mode 100644 index c943550b..00000000 --- a/images/11.0/php7.3-fpm-alpine-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -11.0.5-fpm-alpine 11.0-fpm-alpine diff --git a/images/11.0/php7.3-fpm-alpine-i386/docker-compose.test.yml b/images/11.0/php7.3-fpm-alpine-i386/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/11.0/php7.3-fpm-alpine-i386/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/11.0/php7.3-fpm-alpine-i386/hooks/build b/images/11.0/php7.3-fpm-alpine-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/11.0/php7.3-fpm-alpine-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/11.0/php7.3-fpm-alpine-i386/hooks/post_push b/images/11.0/php7.3-fpm-alpine-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/11.0/php7.3-fpm-alpine-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-fpm-alpine-i386/hooks/pre_push b/images/11.0/php7.3-fpm-alpine-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/11.0/php7.3-fpm-alpine-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-fpm-alpine-i386/hooks/pre_test b/images/11.0/php7.3-fpm-alpine-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/11.0/php7.3-fpm-alpine-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/10.0/php7.3-fpm-amd64/.dockerignore b/images/11.0/php7.3-fpm-alpine/.dockerignore similarity index 100% rename from images/10.0/php7.3-fpm-amd64/.dockerignore rename to images/11.0/php7.3-fpm-alpine/.dockerignore diff --git a/images/11.0/php7.3-fpm-alpine-amd64/.dockertags b/images/11.0/php7.3-fpm-alpine/.dockertags similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/.dockertags rename to images/11.0/php7.3-fpm-alpine/.dockertags diff --git a/images/10.0/php7.3-fpm-amd64/.env b/images/11.0/php7.3-fpm-alpine/.env similarity index 100% rename from images/10.0/php7.3-fpm-amd64/.env rename to images/11.0/php7.3-fpm-alpine/.env diff --git a/images/11.0/php7.3-fpm-alpine-i386/Dockerfile b/images/11.0/php7.3-fpm-alpine/Dockerfile similarity index 99% rename from images/11.0/php7.3-fpm-alpine-i386/Dockerfile rename to images/11.0/php7.3-fpm-alpine/Dockerfile index 71a5de8f..7541434b 100644 --- a/images/11.0/php7.3-fpm-alpine-i386/Dockerfile +++ b/images/11.0/php7.3-fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-fpm-alpine +FROM php:7.3-fpm-alpine # Install the packages we need # Install the PHP extensions we need diff --git a/images/10.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml b/images/11.0/php7.3-fpm-alpine/docker-compose.test.yml similarity index 99% rename from images/10.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml rename to images/11.0/php7.3-fpm-alpine/docker-compose.test.yml index 428bbae2..9e035418 100644 --- a/images/10.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml +++ b/images/11.0/php7.3-fpm-alpine/docker-compose.test.yml @@ -35,7 +35,6 @@ services: context: ./ dockerfile: Dockerfile args: - - TAG=${TAG} - VCS_REF=${VCS_REF} - BUILD_DATE=${BUILD_DATE} image: ${IMAGE_NAME} diff --git a/images/10.0/php7.3-fpm-amd64/entrypoint.sh b/images/11.0/php7.3-fpm-alpine/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-fpm-amd64/entrypoint.sh rename to images/11.0/php7.3-fpm-alpine/entrypoint.sh diff --git a/images/10.0/php7.3-fpm-amd64/hooks/README.md b/images/11.0/php7.3-fpm-alpine/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/10.0/php7.3-fpm-amd64/hooks/README.md rename to images/11.0/php7.3-fpm-alpine/hooks/README.md diff --git a/images/11.0/php7.3-fpm-alpine/hooks/build b/images/11.0/php7.3-fpm-alpine/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/11.0/php7.3-fpm-alpine/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/11.0/php7.3-fpm-alpine/hooks/post_push b/images/11.0/php7.3-fpm-alpine/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/11.0/php7.3-fpm-alpine/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/10.0/php7.3-fpm-amd64/hooks/post_test b/images/11.0/php7.3-fpm-alpine/hooks/post_test similarity index 100% rename from images/10.0/php7.3-fpm-amd64/hooks/post_test rename to images/11.0/php7.3-fpm-alpine/hooks/post_test diff --git a/images/11.0/php7.3-fpm-alpine/hooks/pre_push b/images/11.0/php7.3-fpm-alpine/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/11.0/php7.3-fpm-alpine/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/11.0/php7.3-fpm-alpine/hooks/pre_test b/images/11.0/php7.3-fpm-alpine/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/11.0/php7.3-fpm-alpine/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/11.0/php7.3-apache-i386/hooks/run b/images/11.0/php7.3-fpm-alpine/hooks/run similarity index 100% rename from images/11.0/php7.3-apache-i386/hooks/run rename to images/11.0/php7.3-fpm-alpine/hooks/run diff --git a/images/11.0/php7.3-fpm-alpine/hooks/run_push b/images/11.0/php7.3-fpm-alpine/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/11.0/php7.3-fpm-alpine/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/10.0/php7.3-fpm-amd64/hooks/test b/images/11.0/php7.3-fpm-alpine/hooks/test similarity index 100% rename from images/10.0/php7.3-fpm-amd64/hooks/test rename to images/11.0/php7.3-fpm-alpine/hooks/test diff --git a/images/10.0/php7.3-fpm-amd64/nginx/templates/default.conf.template b/images/11.0/php7.3-fpm-alpine/nginx/templates/default.conf.template similarity index 100% rename from images/10.0/php7.3-fpm-amd64/nginx/templates/default.conf.template rename to images/11.0/php7.3-fpm-alpine/nginx/templates/default.conf.template diff --git a/images/10.0/php7.3-fpm-amd64/test/Dockerfile b/images/11.0/php7.3-fpm-alpine/test/Dockerfile similarity index 100% rename from images/10.0/php7.3-fpm-amd64/test/Dockerfile rename to images/11.0/php7.3-fpm-alpine/test/Dockerfile diff --git a/images/10.0/php7.3-fpm-amd64/test/docker_test.sh b/images/11.0/php7.3-fpm-alpine/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-fpm-amd64/test/docker_test.sh rename to images/11.0/php7.3-fpm-alpine/test/docker_test.sh diff --git a/images/11.0/php7.3-fpm-amd64/Dockerfile b/images/11.0/php7.3-fpm-amd64/Dockerfile deleted file mode 100644 index 7d9b7557..00000000 --- a/images/11.0/php7.3-fpm-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-fpm - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=11.0.5 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/11.0/php7.3-fpm-amd64/docker-compose.test.yml b/images/11.0/php7.3-fpm-amd64/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/11.0/php7.3-fpm-amd64/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/11.0/php7.3-fpm-amd64/hooks/build b/images/11.0/php7.3-fpm-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/11.0/php7.3-fpm-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/11.0/php7.3-fpm-amd64/hooks/post_push b/images/11.0/php7.3-fpm-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/11.0/php7.3-fpm-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-fpm-amd64/hooks/pre_push b/images/11.0/php7.3-fpm-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/11.0/php7.3-fpm-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-fpm-amd64/hooks/pre_test b/images/11.0/php7.3-fpm-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/11.0/php7.3-fpm-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/11.0/php7.3-fpm-amd64/hooks/run b/images/11.0/php7.3-fpm-amd64/hooks/run deleted file mode 100755 index bf5fb8d9..00000000 --- a/images/11.0/php7.3-fpm-amd64/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=11.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/11.0/php7.3-fpm-i386/.dockertags b/images/11.0/php7.3-fpm-i386/.dockertags deleted file mode 100644 index 7ed49497..00000000 --- a/images/11.0/php7.3-fpm-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -11.0.5-fpm 11.0-fpm diff --git a/images/11.0/php7.3-fpm-i386/docker-compose.test.yml b/images/11.0/php7.3-fpm-i386/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/11.0/php7.3-fpm-i386/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/11.0/php7.3-fpm-i386/hooks/build b/images/11.0/php7.3-fpm-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/11.0/php7.3-fpm-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/11.0/php7.3-fpm-i386/hooks/post_push b/images/11.0/php7.3-fpm-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/11.0/php7.3-fpm-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-fpm-i386/hooks/pre_push b/images/11.0/php7.3-fpm-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/11.0/php7.3-fpm-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/11.0/php7.3-fpm-i386/hooks/pre_test b/images/11.0/php7.3-fpm-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/11.0/php7.3-fpm-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/11.0/php7.3-fpm-i386/hooks/run b/images/11.0/php7.3-fpm-i386/hooks/run deleted file mode 100755 index bf5fb8d9..00000000 --- a/images/11.0/php7.3-fpm-i386/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=11.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/10.0/php7.3-fpm-i386/.dockerignore b/images/11.0/php7.3-fpm/.dockerignore similarity index 100% rename from images/10.0/php7.3-fpm-i386/.dockerignore rename to images/11.0/php7.3-fpm/.dockerignore diff --git a/images/11.0/php7.3-fpm-amd64/.dockertags b/images/11.0/php7.3-fpm/.dockertags similarity index 100% rename from images/11.0/php7.3-fpm-amd64/.dockertags rename to images/11.0/php7.3-fpm/.dockertags diff --git a/images/10.0/php7.3-fpm-i386/.env b/images/11.0/php7.3-fpm/.env similarity index 100% rename from images/10.0/php7.3-fpm-i386/.env rename to images/11.0/php7.3-fpm/.env diff --git a/images/11.0/php7.3-fpm-i386/Dockerfile b/images/11.0/php7.3-fpm/Dockerfile similarity index 99% rename from images/11.0/php7.3-fpm-i386/Dockerfile rename to images/11.0/php7.3-fpm/Dockerfile index ee381827..61cf9e73 100644 --- a/images/11.0/php7.3-fpm-i386/Dockerfile +++ b/images/11.0/php7.3-fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-fpm +FROM php:7.3-fpm # Install the packages we need # Install the PHP extensions we need diff --git a/images/10.0/php7.3-fpm-i386/docker-compose.test.yml b/images/11.0/php7.3-fpm/docker-compose.test.yml similarity index 99% rename from images/10.0/php7.3-fpm-i386/docker-compose.test.yml rename to images/11.0/php7.3-fpm/docker-compose.test.yml index 428bbae2..9e035418 100644 --- a/images/10.0/php7.3-fpm-i386/docker-compose.test.yml +++ b/images/11.0/php7.3-fpm/docker-compose.test.yml @@ -35,7 +35,6 @@ services: context: ./ dockerfile: Dockerfile args: - - TAG=${TAG} - VCS_REF=${VCS_REF} - BUILD_DATE=${BUILD_DATE} image: ${IMAGE_NAME} diff --git a/images/10.0/php7.3-fpm-i386/entrypoint.sh b/images/11.0/php7.3-fpm/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-fpm-i386/entrypoint.sh rename to images/11.0/php7.3-fpm/entrypoint.sh diff --git a/images/10.0/php7.3-fpm-i386/hooks/README.md b/images/11.0/php7.3-fpm/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/10.0/php7.3-fpm-i386/hooks/README.md rename to images/11.0/php7.3-fpm/hooks/README.md diff --git a/images/11.0/php7.3-fpm/hooks/build b/images/11.0/php7.3-fpm/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/11.0/php7.3-fpm/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/11.0/php7.3-fpm/hooks/post_push b/images/11.0/php7.3-fpm/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/11.0/php7.3-fpm/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/10.0/php7.3-fpm-i386/hooks/post_test b/images/11.0/php7.3-fpm/hooks/post_test similarity index 100% rename from images/10.0/php7.3-fpm-i386/hooks/post_test rename to images/11.0/php7.3-fpm/hooks/post_test diff --git a/images/11.0/php7.3-fpm/hooks/pre_push b/images/11.0/php7.3-fpm/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/11.0/php7.3-fpm/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/11.0/php7.3-fpm/hooks/pre_test b/images/11.0/php7.3-fpm/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/11.0/php7.3-fpm/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/11.0/php7.3-fpm-alpine-amd64/hooks/run b/images/11.0/php7.3-fpm/hooks/run similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/hooks/run rename to images/11.0/php7.3-fpm/hooks/run diff --git a/images/11.0/php7.3-fpm/hooks/run_push b/images/11.0/php7.3-fpm/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/11.0/php7.3-fpm/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/10.0/php7.3-fpm-i386/hooks/test b/images/11.0/php7.3-fpm/hooks/test similarity index 100% rename from images/10.0/php7.3-fpm-i386/hooks/test rename to images/11.0/php7.3-fpm/hooks/test diff --git a/images/10.0/php7.3-fpm-i386/nginx/templates/default.conf.template b/images/11.0/php7.3-fpm/nginx/templates/default.conf.template similarity index 100% rename from images/10.0/php7.3-fpm-i386/nginx/templates/default.conf.template rename to images/11.0/php7.3-fpm/nginx/templates/default.conf.template diff --git a/images/10.0/php7.3-fpm-i386/test/Dockerfile b/images/11.0/php7.3-fpm/test/Dockerfile similarity index 100% rename from images/10.0/php7.3-fpm-i386/test/Dockerfile rename to images/11.0/php7.3-fpm/test/Dockerfile diff --git a/images/10.0/php7.3-fpm-i386/test/docker_test.sh b/images/11.0/php7.3-fpm/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/10.0/php7.3-fpm-i386/test/docker_test.sh rename to images/11.0/php7.3-fpm/test/docker_test.sh diff --git a/images/12.0/php7.3-apache-amd64/Dockerfile b/images/12.0/php7.3-apache-amd64/Dockerfile deleted file mode 100644 index a06baa7f..00000000 --- a/images/12.0/php7.3-apache-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-apache - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=12.0.5 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/12.0/php7.3-apache-amd64/docker-compose.test.yml b/images/12.0/php7.3-apache-amd64/docker-compose.test.yml deleted file mode 100644 index d4728e02..00000000 --- a/images/12.0/php7.3-apache-amd64/docker-compose.test.yml +++ /dev/null @@ -1,109 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr_db - - dolibarr - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "80" - #ports: - # - "8080:80" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_HOST=dolibarr_db # same as mysql container name - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: mariadb:latest - container_name: dolibarr_db - #restart: always - command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE - healthcheck: - test: - [ - "CMD", - "mysqladmin", - "ping", - "-h", - "localhost", - "--password=${DOLIBARR_DB_ROOT_PWD}", - ] - timeout: 10s - retries: 5 - expose: - - "3306" - #ports: - # - "33306:3306" - volumes: - - db:/var/lib/mysql - #- /srv/dolibarr/db:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=${DOLIBARR_DB_ROOT_PWD} - - MYSQL_DATABASE=${DOLIBARR_DB_NAME} - - MYSQL_USER=${DOLIBARR_DB_USER} - - MYSQL_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-apache-amd64/hooks/build b/images/12.0/php7.3-apache-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/12.0/php7.3-apache-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/12.0/php7.3-apache-amd64/hooks/post_push b/images/12.0/php7.3-apache-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/12.0/php7.3-apache-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-apache-amd64/hooks/pre_push b/images/12.0/php7.3-apache-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/12.0/php7.3-apache-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-apache-amd64/hooks/pre_test b/images/12.0/php7.3-apache-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/12.0/php7.3-apache-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/12.0/php7.3-apache-i386/.dockertags b/images/12.0/php7.3-apache-i386/.dockertags deleted file mode 100644 index a007dad2..00000000 --- a/images/12.0/php7.3-apache-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -12.0.5-apache 12.0-apache 12.0.5 12.0 diff --git a/images/12.0/php7.3-apache-i386/docker-compose.test.yml b/images/12.0/php7.3-apache-i386/docker-compose.test.yml deleted file mode 100644 index d4728e02..00000000 --- a/images/12.0/php7.3-apache-i386/docker-compose.test.yml +++ /dev/null @@ -1,109 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr_db - - dolibarr - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "80" - #ports: - # - "8080:80" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_HOST=dolibarr_db # same as mysql container name - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: mariadb:latest - container_name: dolibarr_db - #restart: always - command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE - healthcheck: - test: - [ - "CMD", - "mysqladmin", - "ping", - "-h", - "localhost", - "--password=${DOLIBARR_DB_ROOT_PWD}", - ] - timeout: 10s - retries: 5 - expose: - - "3306" - #ports: - # - "33306:3306" - volumes: - - db:/var/lib/mysql - #- /srv/dolibarr/db:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=${DOLIBARR_DB_ROOT_PWD} - - MYSQL_DATABASE=${DOLIBARR_DB_NAME} - - MYSQL_USER=${DOLIBARR_DB_USER} - - MYSQL_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-apache-i386/hooks/build b/images/12.0/php7.3-apache-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/12.0/php7.3-apache-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/12.0/php7.3-apache-i386/hooks/post_push b/images/12.0/php7.3-apache-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/12.0/php7.3-apache-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-apache-i386/hooks/pre_push b/images/12.0/php7.3-apache-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/12.0/php7.3-apache-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-apache-i386/hooks/pre_test b/images/12.0/php7.3-apache-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/12.0/php7.3-apache-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/11.0/php7.3-apache-amd64/.dockerignore b/images/12.0/php7.3-apache/.dockerignore similarity index 100% rename from images/11.0/php7.3-apache-amd64/.dockerignore rename to images/12.0/php7.3-apache/.dockerignore diff --git a/images/12.0/php7.3-apache-amd64/.dockertags b/images/12.0/php7.3-apache/.dockertags similarity index 100% rename from images/12.0/php7.3-apache-amd64/.dockertags rename to images/12.0/php7.3-apache/.dockertags diff --git a/images/11.0/php7.3-apache-amd64/.env b/images/12.0/php7.3-apache/.env similarity index 100% rename from images/11.0/php7.3-apache-amd64/.env rename to images/12.0/php7.3-apache/.env diff --git a/images/12.0/php7.3-apache-i386/Dockerfile b/images/12.0/php7.3-apache/Dockerfile similarity index 99% rename from images/12.0/php7.3-apache-i386/Dockerfile rename to images/12.0/php7.3-apache/Dockerfile index 7eef7d82..6b3eb175 100644 --- a/images/12.0/php7.3-apache-i386/Dockerfile +++ b/images/12.0/php7.3-apache/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-apache +FROM php:7.3-apache # Install the packages we need # Install the PHP extensions we need diff --git a/images/11.0/php7.3-apache-i386/docker-compose.test.yml b/images/12.0/php7.3-apache/docker-compose.test.yml similarity index 99% rename from images/11.0/php7.3-apache-i386/docker-compose.test.yml rename to images/12.0/php7.3-apache/docker-compose.test.yml index d4728e02..ec96a5de 100644 --- a/images/11.0/php7.3-apache-i386/docker-compose.test.yml +++ b/images/12.0/php7.3-apache/docker-compose.test.yml @@ -35,7 +35,6 @@ services: context: ./ dockerfile: Dockerfile args: - - TAG=${TAG} - VCS_REF=${VCS_REF} - BUILD_DATE=${BUILD_DATE} image: ${IMAGE_NAME} diff --git a/images/11.0/php7.3-apache-amd64/entrypoint.sh b/images/12.0/php7.3-apache/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-apache-amd64/entrypoint.sh rename to images/12.0/php7.3-apache/entrypoint.sh diff --git a/images/11.0/php7.3-apache-amd64/hooks/README.md b/images/12.0/php7.3-apache/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/11.0/php7.3-apache-amd64/hooks/README.md rename to images/12.0/php7.3-apache/hooks/README.md diff --git a/images/12.0/php7.3-apache/hooks/build b/images/12.0/php7.3-apache/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/12.0/php7.3-apache/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/12.0/php7.3-apache/hooks/post_push b/images/12.0/php7.3-apache/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/12.0/php7.3-apache/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/11.0/php7.3-apache-amd64/hooks/post_test b/images/12.0/php7.3-apache/hooks/post_test similarity index 100% rename from images/11.0/php7.3-apache-amd64/hooks/post_test rename to images/12.0/php7.3-apache/hooks/post_test diff --git a/images/12.0/php7.3-apache/hooks/pre_push b/images/12.0/php7.3-apache/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/12.0/php7.3-apache/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/12.0/php7.3-apache/hooks/pre_test b/images/12.0/php7.3-apache/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/12.0/php7.3-apache/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/12.0/php7.3-apache-amd64/hooks/run b/images/12.0/php7.3-apache/hooks/run similarity index 100% rename from images/12.0/php7.3-apache-amd64/hooks/run rename to images/12.0/php7.3-apache/hooks/run diff --git a/images/12.0/php7.3-apache/hooks/run_push b/images/12.0/php7.3-apache/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/12.0/php7.3-apache/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/11.0/php7.3-apache-amd64/hooks/test b/images/12.0/php7.3-apache/hooks/test similarity index 100% rename from images/11.0/php7.3-apache-amd64/hooks/test rename to images/12.0/php7.3-apache/hooks/test diff --git a/images/11.0/php7.3-apache-amd64/test/Dockerfile b/images/12.0/php7.3-apache/test/Dockerfile similarity index 100% rename from images/11.0/php7.3-apache-amd64/test/Dockerfile rename to images/12.0/php7.3-apache/test/Dockerfile diff --git a/images/11.0/php7.3-apache-amd64/test/docker_test.sh b/images/12.0/php7.3-apache/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-apache-amd64/test/docker_test.sh rename to images/12.0/php7.3-apache/test/docker_test.sh diff --git a/images/12.0/php7.3-fpm-alpine-amd64/Dockerfile b/images/12.0/php7.3-fpm-alpine-amd64/Dockerfile deleted file mode 100644 index 3cef6302..00000000 --- a/images/12.0/php7.3-fpm-alpine-amd64/Dockerfile +++ /dev/null @@ -1,160 +0,0 @@ -FROM amd64/php:7.3-fpm-alpine - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apk add --no-cache \ - bzip2 \ - icu-libs \ - imagemagick \ - libldap \ - libpq \ - libpng \ - mysql-client \ - rsync \ - ssmtp \ - shadow \ - unzip \ - zip \ - ; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - curl-dev \ - freetype-dev \ - gcc \ - g++ \ - icu-dev \ - libjpeg-turbo-dev \ - imagemagick-dev \ - imagemagick-libs \ - libmcrypt-dev \ - libpng-dev \ - libtool \ - libxml2-dev \ - libzip-dev \ - make \ - openldap-dev \ - postgresql-dev \ - postgresql-libs \ - unzip \ - zlib-dev \ - ; \ - docker-php-ext-configure ldap; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - apk --purge del .build-deps; \ - rm -rf /var/cache/apk/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=82 \ - WWW_GROUP_ID=82 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=12.0.5 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=${DOLI_VERSION} \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/12.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml b/images/12.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/12.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-fpm-alpine-amd64/hooks/build b/images/12.0/php7.3-fpm-alpine-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/12.0/php7.3-fpm-alpine-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/12.0/php7.3-fpm-alpine-amd64/hooks/post_push b/images/12.0/php7.3-fpm-alpine-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/12.0/php7.3-fpm-alpine-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-fpm-alpine-amd64/hooks/pre_push b/images/12.0/php7.3-fpm-alpine-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/12.0/php7.3-fpm-alpine-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-fpm-alpine-amd64/hooks/pre_test b/images/12.0/php7.3-fpm-alpine-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/12.0/php7.3-fpm-alpine-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/12.0/php7.3-fpm-alpine-i386/.dockertags b/images/12.0/php7.3-fpm-alpine-i386/.dockertags deleted file mode 100644 index 94575fa5..00000000 --- a/images/12.0/php7.3-fpm-alpine-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -12.0.5-fpm-alpine 12.0-fpm-alpine diff --git a/images/12.0/php7.3-fpm-alpine-i386/docker-compose.test.yml b/images/12.0/php7.3-fpm-alpine-i386/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/12.0/php7.3-fpm-alpine-i386/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-fpm-alpine-i386/hooks/build b/images/12.0/php7.3-fpm-alpine-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/12.0/php7.3-fpm-alpine-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/12.0/php7.3-fpm-alpine-i386/hooks/post_push b/images/12.0/php7.3-fpm-alpine-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/12.0/php7.3-fpm-alpine-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-fpm-alpine-i386/hooks/pre_push b/images/12.0/php7.3-fpm-alpine-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/12.0/php7.3-fpm-alpine-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-fpm-alpine-i386/hooks/pre_test b/images/12.0/php7.3-fpm-alpine-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/12.0/php7.3-fpm-alpine-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/12.0/php7.3-fpm-alpine-i386/hooks/run b/images/12.0/php7.3-fpm-alpine-i386/hooks/run deleted file mode 100755 index ce4ca6a3..00000000 --- a/images/12.0/php7.3-fpm-alpine-i386/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=12.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/11.0/php7.3-apache-i386/.dockerignore b/images/12.0/php7.3-fpm-alpine/.dockerignore similarity index 100% rename from images/11.0/php7.3-apache-i386/.dockerignore rename to images/12.0/php7.3-fpm-alpine/.dockerignore diff --git a/images/12.0/php7.3-fpm-alpine-amd64/.dockertags b/images/12.0/php7.3-fpm-alpine/.dockertags similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/.dockertags rename to images/12.0/php7.3-fpm-alpine/.dockertags diff --git a/images/11.0/php7.3-apache-i386/.env b/images/12.0/php7.3-fpm-alpine/.env similarity index 100% rename from images/11.0/php7.3-apache-i386/.env rename to images/12.0/php7.3-fpm-alpine/.env diff --git a/images/12.0/php7.3-fpm-alpine-i386/Dockerfile b/images/12.0/php7.3-fpm-alpine/Dockerfile similarity index 99% rename from images/12.0/php7.3-fpm-alpine-i386/Dockerfile rename to images/12.0/php7.3-fpm-alpine/Dockerfile index 272ca969..4546d338 100644 --- a/images/12.0/php7.3-fpm-alpine-i386/Dockerfile +++ b/images/12.0/php7.3-fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-fpm-alpine +FROM php:7.3-fpm-alpine # Install the packages we need # Install the PHP extensions we need diff --git a/images/12.0/php7.3-fpm-alpine/docker-compose.test.yml b/images/12.0/php7.3-fpm-alpine/docker-compose.test.yml new file mode 100644 index 00000000..9e035418 --- /dev/null +++ b/images/12.0/php7.3-fpm-alpine/docker-compose.test.yml @@ -0,0 +1,130 @@ +version: "2.3" + +volumes: + db: + data: + documents: + scripts: + +services: + # https://docs.docker.com/docker-hub/builds/automated-testing/ + sut: + build: + context: ./test + dockerfile: Dockerfile + depends_on: + - dolibarr + - dolibarr_nginx + volumes_from: + - dolibarr + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + - DOCKER_TEST_CONTAINER=dolibarr + - DOCKER_WEB_CONTAINER=dolibarr_nginx + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr: + build: + context: ./ + dockerfile: Dockerfile + args: + - VCS_REF=${VCS_REF} + - BUILD_DATE=${BUILD_DATE} + image: ${IMAGE_NAME} + container_name: dolibarr + #restart: always + depends_on: + dolibarr_db: + condition: service_healthy + links: + - dolibarr_db + expose: + - "9000" + #ports: + # - "9090:9000" + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + #- /srv/dolibarr/html:/var/www/html + #- /srv/dolibarr/documents:/var/www/documents + #- /srv/dolibarr/scripts:/var/www/scripts + environment: + - DOLI_DB_TYPE=pgsql + - DOLI_DB_HOST=dolibarr_db # same as pgsql container name + - DOLI_DB_PORT=5432 + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_db: + image: postgres:latest + container_name: dolibarr_db + #restart: always + healthcheck: + test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] + interval: 60s + retries: 5 + #start-period: 10s + mem_limit: 256M + memswap_limit: 256M + expose: + - "5432" + #ports: + # - "55432:5432" + volumes: + - db:/var/lib/postgresql/data + #- /srv/dolibarr/db:/var/lib/postgresql/data + environment: + - POSTGRES_DB=${DOLIBARR_DB_NAME} + - POSTGRES_USER=${DOLIBARR_DB_USER} + - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_nginx: + image: nginx:latest + container_name: dolibarr_nginx + #restart: always + expose: + - "80" + #ports: + # - "8080:80" + # # If you need SSL connection + # - "8443:443" + depends_on: + - dolibarr + links: + - dolibarr + volumes: + - data:/var/www/html + #- /srv/dolibarr/html:/var/www/html + - ./nginx/templates:/etc/nginx/templates + # Provide a custom nginx conf + #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + # If you need SSL connection, you can provide your own certificates + # - ./certs:/etc/letsencrypt + # - ./certs-data:/data/letsencrypt + environment: + - NGINX_HOST=localhost # set your local domain or your live domain + - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name + + dolibarr_mailer: + image: sj26/mailcatcher:latest + hostname: dolibarr_mailer + container_name: dolibarr_mailer + restart: always + expose: + - 1025 + ports: + - "1025:1025" + - "1080:1080" + # If you want, you can sync time & timezone with host + #volumes: + # - /etc/localtime:/etc/localtime:ro + # - /etc/timezone:/etc/timezone:ro diff --git a/images/11.0/php7.3-apache-i386/entrypoint.sh b/images/12.0/php7.3-fpm-alpine/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-apache-i386/entrypoint.sh rename to images/12.0/php7.3-fpm-alpine/entrypoint.sh diff --git a/images/11.0/php7.3-apache-i386/hooks/README.md b/images/12.0/php7.3-fpm-alpine/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/11.0/php7.3-apache-i386/hooks/README.md rename to images/12.0/php7.3-fpm-alpine/hooks/README.md diff --git a/images/12.0/php7.3-fpm-alpine/hooks/build b/images/12.0/php7.3-fpm-alpine/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/12.0/php7.3-fpm-alpine/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/12.0/php7.3-fpm-alpine/hooks/post_push b/images/12.0/php7.3-fpm-alpine/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/12.0/php7.3-fpm-alpine/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/11.0/php7.3-apache-i386/hooks/post_test b/images/12.0/php7.3-fpm-alpine/hooks/post_test similarity index 100% rename from images/11.0/php7.3-apache-i386/hooks/post_test rename to images/12.0/php7.3-fpm-alpine/hooks/post_test diff --git a/images/12.0/php7.3-fpm-alpine/hooks/pre_push b/images/12.0/php7.3-fpm-alpine/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/12.0/php7.3-fpm-alpine/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/12.0/php7.3-fpm-alpine/hooks/pre_test b/images/12.0/php7.3-fpm-alpine/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/12.0/php7.3-fpm-alpine/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/12.0/php7.3-apache-i386/hooks/run b/images/12.0/php7.3-fpm-alpine/hooks/run similarity index 100% rename from images/12.0/php7.3-apache-i386/hooks/run rename to images/12.0/php7.3-fpm-alpine/hooks/run diff --git a/images/12.0/php7.3-fpm-alpine/hooks/run_push b/images/12.0/php7.3-fpm-alpine/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/12.0/php7.3-fpm-alpine/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/11.0/php7.3-apache-i386/hooks/test b/images/12.0/php7.3-fpm-alpine/hooks/test similarity index 100% rename from images/11.0/php7.3-apache-i386/hooks/test rename to images/12.0/php7.3-fpm-alpine/hooks/test diff --git a/images/11.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template b/images/12.0/php7.3-fpm-alpine/nginx/templates/default.conf.template similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template rename to images/12.0/php7.3-fpm-alpine/nginx/templates/default.conf.template diff --git a/images/11.0/php7.3-apache-i386/test/Dockerfile b/images/12.0/php7.3-fpm-alpine/test/Dockerfile similarity index 100% rename from images/11.0/php7.3-apache-i386/test/Dockerfile rename to images/12.0/php7.3-fpm-alpine/test/Dockerfile diff --git a/images/11.0/php7.3-apache-i386/test/docker_test.sh b/images/12.0/php7.3-fpm-alpine/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-apache-i386/test/docker_test.sh rename to images/12.0/php7.3-fpm-alpine/test/docker_test.sh diff --git a/images/12.0/php7.3-fpm-amd64/Dockerfile b/images/12.0/php7.3-fpm-amd64/Dockerfile deleted file mode 100644 index 9a9613b0..00000000 --- a/images/12.0/php7.3-fpm-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-fpm - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=12.0.5 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/12.0/php7.3-fpm-amd64/docker-compose.test.yml b/images/12.0/php7.3-fpm-amd64/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/12.0/php7.3-fpm-amd64/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-fpm-amd64/hooks/build b/images/12.0/php7.3-fpm-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/12.0/php7.3-fpm-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/12.0/php7.3-fpm-amd64/hooks/post_push b/images/12.0/php7.3-fpm-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/12.0/php7.3-fpm-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-fpm-amd64/hooks/pre_push b/images/12.0/php7.3-fpm-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/12.0/php7.3-fpm-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-fpm-amd64/hooks/pre_test b/images/12.0/php7.3-fpm-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/12.0/php7.3-fpm-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/12.0/php7.3-fpm-amd64/hooks/run b/images/12.0/php7.3-fpm-amd64/hooks/run deleted file mode 100755 index ce4ca6a3..00000000 --- a/images/12.0/php7.3-fpm-amd64/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=12.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/12.0/php7.3-fpm-i386/.dockertags b/images/12.0/php7.3-fpm-i386/.dockertags deleted file mode 100644 index a8be8161..00000000 --- a/images/12.0/php7.3-fpm-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -12.0.5-fpm 12.0-fpm diff --git a/images/12.0/php7.3-fpm-i386/docker-compose.test.yml b/images/12.0/php7.3-fpm-i386/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/12.0/php7.3-fpm-i386/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-fpm-i386/hooks/build b/images/12.0/php7.3-fpm-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/12.0/php7.3-fpm-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/12.0/php7.3-fpm-i386/hooks/post_push b/images/12.0/php7.3-fpm-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/12.0/php7.3-fpm-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-fpm-i386/hooks/pre_push b/images/12.0/php7.3-fpm-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/12.0/php7.3-fpm-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/12.0/php7.3-fpm-i386/hooks/pre_test b/images/12.0/php7.3-fpm-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/12.0/php7.3-fpm-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/12.0/php7.3-fpm-i386/hooks/run b/images/12.0/php7.3-fpm-i386/hooks/run deleted file mode 100755 index ce4ca6a3..00000000 --- a/images/12.0/php7.3-fpm-i386/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=12.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/11.0/php7.3-fpm-alpine-amd64/.dockerignore b/images/12.0/php7.3-fpm/.dockerignore similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/.dockerignore rename to images/12.0/php7.3-fpm/.dockerignore diff --git a/images/12.0/php7.3-fpm-amd64/.dockertags b/images/12.0/php7.3-fpm/.dockertags similarity index 100% rename from images/12.0/php7.3-fpm-amd64/.dockertags rename to images/12.0/php7.3-fpm/.dockertags diff --git a/images/11.0/php7.3-fpm-alpine-amd64/.env b/images/12.0/php7.3-fpm/.env similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/.env rename to images/12.0/php7.3-fpm/.env diff --git a/images/12.0/php7.3-fpm-i386/Dockerfile b/images/12.0/php7.3-fpm/Dockerfile similarity index 99% rename from images/12.0/php7.3-fpm-i386/Dockerfile rename to images/12.0/php7.3-fpm/Dockerfile index 0aa8ed85..062d57ca 100644 --- a/images/12.0/php7.3-fpm-i386/Dockerfile +++ b/images/12.0/php7.3-fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-fpm +FROM php:7.3-fpm # Install the packages we need # Install the PHP extensions we need diff --git a/images/12.0/php7.3-fpm/docker-compose.test.yml b/images/12.0/php7.3-fpm/docker-compose.test.yml new file mode 100644 index 00000000..9e035418 --- /dev/null +++ b/images/12.0/php7.3-fpm/docker-compose.test.yml @@ -0,0 +1,130 @@ +version: "2.3" + +volumes: + db: + data: + documents: + scripts: + +services: + # https://docs.docker.com/docker-hub/builds/automated-testing/ + sut: + build: + context: ./test + dockerfile: Dockerfile + depends_on: + - dolibarr + - dolibarr_nginx + volumes_from: + - dolibarr + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + - DOCKER_TEST_CONTAINER=dolibarr + - DOCKER_WEB_CONTAINER=dolibarr_nginx + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr: + build: + context: ./ + dockerfile: Dockerfile + args: + - VCS_REF=${VCS_REF} + - BUILD_DATE=${BUILD_DATE} + image: ${IMAGE_NAME} + container_name: dolibarr + #restart: always + depends_on: + dolibarr_db: + condition: service_healthy + links: + - dolibarr_db + expose: + - "9000" + #ports: + # - "9090:9000" + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + #- /srv/dolibarr/html:/var/www/html + #- /srv/dolibarr/documents:/var/www/documents + #- /srv/dolibarr/scripts:/var/www/scripts + environment: + - DOLI_DB_TYPE=pgsql + - DOLI_DB_HOST=dolibarr_db # same as pgsql container name + - DOLI_DB_PORT=5432 + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_db: + image: postgres:latest + container_name: dolibarr_db + #restart: always + healthcheck: + test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] + interval: 60s + retries: 5 + #start-period: 10s + mem_limit: 256M + memswap_limit: 256M + expose: + - "5432" + #ports: + # - "55432:5432" + volumes: + - db:/var/lib/postgresql/data + #- /srv/dolibarr/db:/var/lib/postgresql/data + environment: + - POSTGRES_DB=${DOLIBARR_DB_NAME} + - POSTGRES_USER=${DOLIBARR_DB_USER} + - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_nginx: + image: nginx:latest + container_name: dolibarr_nginx + #restart: always + expose: + - "80" + #ports: + # - "8080:80" + # # If you need SSL connection + # - "8443:443" + depends_on: + - dolibarr + links: + - dolibarr + volumes: + - data:/var/www/html + #- /srv/dolibarr/html:/var/www/html + - ./nginx/templates:/etc/nginx/templates + # Provide a custom nginx conf + #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + # If you need SSL connection, you can provide your own certificates + # - ./certs:/etc/letsencrypt + # - ./certs-data:/data/letsencrypt + environment: + - NGINX_HOST=localhost # set your local domain or your live domain + - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name + + dolibarr_mailer: + image: sj26/mailcatcher:latest + hostname: dolibarr_mailer + container_name: dolibarr_mailer + restart: always + expose: + - 1025 + ports: + - "1025:1025" + - "1080:1080" + # If you want, you can sync time & timezone with host + #volumes: + # - /etc/localtime:/etc/localtime:ro + # - /etc/timezone:/etc/timezone:ro diff --git a/images/11.0/php7.3-fpm-alpine-amd64/entrypoint.sh b/images/12.0/php7.3-fpm/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/entrypoint.sh rename to images/12.0/php7.3-fpm/entrypoint.sh diff --git a/images/11.0/php7.3-fpm-alpine-amd64/hooks/README.md b/images/12.0/php7.3-fpm/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/hooks/README.md rename to images/12.0/php7.3-fpm/hooks/README.md diff --git a/images/12.0/php7.3-fpm/hooks/build b/images/12.0/php7.3-fpm/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/12.0/php7.3-fpm/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/12.0/php7.3-fpm/hooks/post_push b/images/12.0/php7.3-fpm/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/12.0/php7.3-fpm/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/11.0/php7.3-fpm-alpine-amd64/hooks/post_test b/images/12.0/php7.3-fpm/hooks/post_test similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/hooks/post_test rename to images/12.0/php7.3-fpm/hooks/post_test diff --git a/images/12.0/php7.3-fpm/hooks/pre_push b/images/12.0/php7.3-fpm/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/12.0/php7.3-fpm/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/12.0/php7.3-fpm/hooks/pre_test b/images/12.0/php7.3-fpm/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/12.0/php7.3-fpm/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/12.0/php7.3-fpm-alpine-amd64/hooks/run b/images/12.0/php7.3-fpm/hooks/run similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/hooks/run rename to images/12.0/php7.3-fpm/hooks/run diff --git a/images/12.0/php7.3-fpm/hooks/run_push b/images/12.0/php7.3-fpm/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/12.0/php7.3-fpm/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/11.0/php7.3-fpm-alpine-amd64/hooks/test b/images/12.0/php7.3-fpm/hooks/test similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/hooks/test rename to images/12.0/php7.3-fpm/hooks/test diff --git a/images/11.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template b/images/12.0/php7.3-fpm/nginx/templates/default.conf.template similarity index 100% rename from images/11.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template rename to images/12.0/php7.3-fpm/nginx/templates/default.conf.template diff --git a/images/11.0/php7.3-fpm-alpine-amd64/test/Dockerfile b/images/12.0/php7.3-fpm/test/Dockerfile similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/test/Dockerfile rename to images/12.0/php7.3-fpm/test/Dockerfile diff --git a/images/11.0/php7.3-fpm-alpine-amd64/test/docker_test.sh b/images/12.0/php7.3-fpm/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-fpm-alpine-amd64/test/docker_test.sh rename to images/12.0/php7.3-fpm/test/docker_test.sh diff --git a/images/13.0/php7.3-apache-amd64/.dockerignore b/images/13.0/php7.3-apache-amd64/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/13.0/php7.3-apache-amd64/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/13.0/php7.3-apache-amd64/.env b/images/13.0/php7.3-apache-amd64/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/13.0/php7.3-apache-amd64/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/13.0/php7.3-apache-amd64/Dockerfile b/images/13.0/php7.3-apache-amd64/Dockerfile deleted file mode 100644 index 71333272..00000000 --- a/images/13.0/php7.3-apache-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-apache - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=13.0.4 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/13.0/php7.3-apache-amd64/docker-compose.test.yml b/images/13.0/php7.3-apache-amd64/docker-compose.test.yml deleted file mode 100644 index d4728e02..00000000 --- a/images/13.0/php7.3-apache-amd64/docker-compose.test.yml +++ /dev/null @@ -1,109 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr_db - - dolibarr - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "80" - #ports: - # - "8080:80" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_HOST=dolibarr_db # same as mysql container name - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: mariadb:latest - container_name: dolibarr_db - #restart: always - command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE - healthcheck: - test: - [ - "CMD", - "mysqladmin", - "ping", - "-h", - "localhost", - "--password=${DOLIBARR_DB_ROOT_PWD}", - ] - timeout: 10s - retries: 5 - expose: - - "3306" - #ports: - # - "33306:3306" - volumes: - - db:/var/lib/mysql - #- /srv/dolibarr/db:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=${DOLIBARR_DB_ROOT_PWD} - - MYSQL_DATABASE=${DOLIBARR_DB_NAME} - - MYSQL_USER=${DOLIBARR_DB_USER} - - MYSQL_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/13.0/php7.3-apache-amd64/entrypoint.sh b/images/13.0/php7.3-apache-amd64/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/13.0/php7.3-apache-amd64/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/13.0/php7.3-apache-amd64/hooks/README.md b/images/13.0/php7.3-apache-amd64/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/13.0/php7.3-apache-amd64/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/13.0/php7.3-apache-amd64/hooks/build b/images/13.0/php7.3-apache-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/13.0/php7.3-apache-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/13.0/php7.3-apache-amd64/hooks/post_push b/images/13.0/php7.3-apache-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/13.0/php7.3-apache-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-apache-amd64/hooks/post_test b/images/13.0/php7.3-apache-amd64/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/13.0/php7.3-apache-amd64/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-apache-amd64/hooks/pre_push b/images/13.0/php7.3-apache-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/13.0/php7.3-apache-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-apache-amd64/hooks/pre_test b/images/13.0/php7.3-apache-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/13.0/php7.3-apache-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-apache-amd64/hooks/test b/images/13.0/php7.3-apache-amd64/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/13.0/php7.3-apache-amd64/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/13.0/php7.3-apache-amd64/test/Dockerfile b/images/13.0/php7.3-apache-amd64/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/13.0/php7.3-apache-amd64/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/13.0/php7.3-apache-amd64/test/docker_test.sh b/images/13.0/php7.3-apache-amd64/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/13.0/php7.3-apache-amd64/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/13.0/php7.3-apache-i386/.dockerignore b/images/13.0/php7.3-apache-i386/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/13.0/php7.3-apache-i386/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/13.0/php7.3-apache-i386/.dockertags b/images/13.0/php7.3-apache-i386/.dockertags deleted file mode 100644 index 011d3845..00000000 --- a/images/13.0/php7.3-apache-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -13.0.4-apache 13.0-apache apache 13.0.4 13.0 latest diff --git a/images/13.0/php7.3-apache-i386/.env b/images/13.0/php7.3-apache-i386/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/13.0/php7.3-apache-i386/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/13.0/php7.3-apache-i386/docker-compose.test.yml b/images/13.0/php7.3-apache-i386/docker-compose.test.yml deleted file mode 100644 index d4728e02..00000000 --- a/images/13.0/php7.3-apache-i386/docker-compose.test.yml +++ /dev/null @@ -1,109 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr_db - - dolibarr - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "80" - #ports: - # - "8080:80" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_HOST=dolibarr_db # same as mysql container name - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: mariadb:latest - container_name: dolibarr_db - #restart: always - command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE - healthcheck: - test: - [ - "CMD", - "mysqladmin", - "ping", - "-h", - "localhost", - "--password=${DOLIBARR_DB_ROOT_PWD}", - ] - timeout: 10s - retries: 5 - expose: - - "3306" - #ports: - # - "33306:3306" - volumes: - - db:/var/lib/mysql - #- /srv/dolibarr/db:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=${DOLIBARR_DB_ROOT_PWD} - - MYSQL_DATABASE=${DOLIBARR_DB_NAME} - - MYSQL_USER=${DOLIBARR_DB_USER} - - MYSQL_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/13.0/php7.3-apache-i386/entrypoint.sh b/images/13.0/php7.3-apache-i386/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/13.0/php7.3-apache-i386/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/13.0/php7.3-apache-i386/hooks/README.md b/images/13.0/php7.3-apache-i386/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/13.0/php7.3-apache-i386/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/13.0/php7.3-apache-i386/hooks/build b/images/13.0/php7.3-apache-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/13.0/php7.3-apache-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/13.0/php7.3-apache-i386/hooks/post_push b/images/13.0/php7.3-apache-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/13.0/php7.3-apache-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-apache-i386/hooks/post_test b/images/13.0/php7.3-apache-i386/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/13.0/php7.3-apache-i386/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-apache-i386/hooks/pre_push b/images/13.0/php7.3-apache-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/13.0/php7.3-apache-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-apache-i386/hooks/pre_test b/images/13.0/php7.3-apache-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/13.0/php7.3-apache-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-apache-i386/hooks/test b/images/13.0/php7.3-apache-i386/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/13.0/php7.3-apache-i386/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/13.0/php7.3-apache-i386/test/Dockerfile b/images/13.0/php7.3-apache-i386/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/13.0/php7.3-apache-i386/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/13.0/php7.3-apache-i386/test/docker_test.sh b/images/13.0/php7.3-apache-i386/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/13.0/php7.3-apache-i386/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/11.0/php7.3-fpm-alpine-i386/.dockerignore b/images/13.0/php7.3-apache/.dockerignore similarity index 100% rename from images/11.0/php7.3-fpm-alpine-i386/.dockerignore rename to images/13.0/php7.3-apache/.dockerignore diff --git a/images/13.0/php7.3-apache-amd64/.dockertags b/images/13.0/php7.3-apache/.dockertags similarity index 100% rename from images/13.0/php7.3-apache-amd64/.dockertags rename to images/13.0/php7.3-apache/.dockertags diff --git a/images/11.0/php7.3-fpm-alpine-i386/.env b/images/13.0/php7.3-apache/.env similarity index 100% rename from images/11.0/php7.3-fpm-alpine-i386/.env rename to images/13.0/php7.3-apache/.env diff --git a/images/13.0/php7.3-apache-i386/Dockerfile b/images/13.0/php7.3-apache/Dockerfile similarity index 99% rename from images/13.0/php7.3-apache-i386/Dockerfile rename to images/13.0/php7.3-apache/Dockerfile index 874532c6..1ff22fc4 100644 --- a/images/13.0/php7.3-apache-i386/Dockerfile +++ b/images/13.0/php7.3-apache/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-apache +FROM php:7.3-apache # Install the packages we need # Install the PHP extensions we need diff --git a/images/10.0/php7.3-apache-i386/docker-compose.test.yml b/images/13.0/php7.3-apache/docker-compose.test.yml similarity index 99% rename from images/10.0/php7.3-apache-i386/docker-compose.test.yml rename to images/13.0/php7.3-apache/docker-compose.test.yml index d4728e02..ec96a5de 100644 --- a/images/10.0/php7.3-apache-i386/docker-compose.test.yml +++ b/images/13.0/php7.3-apache/docker-compose.test.yml @@ -35,7 +35,6 @@ services: context: ./ dockerfile: Dockerfile args: - - TAG=${TAG} - VCS_REF=${VCS_REF} - BUILD_DATE=${BUILD_DATE} image: ${IMAGE_NAME} diff --git a/images/11.0/php7.3-fpm-alpine-i386/entrypoint.sh b/images/13.0/php7.3-apache/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-fpm-alpine-i386/entrypoint.sh rename to images/13.0/php7.3-apache/entrypoint.sh diff --git a/images/11.0/php7.3-fpm-alpine-i386/hooks/README.md b/images/13.0/php7.3-apache/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/11.0/php7.3-fpm-alpine-i386/hooks/README.md rename to images/13.0/php7.3-apache/hooks/README.md diff --git a/images/13.0/php7.3-apache/hooks/build b/images/13.0/php7.3-apache/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/13.0/php7.3-apache/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/13.0/php7.3-apache/hooks/post_push b/images/13.0/php7.3-apache/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/13.0/php7.3-apache/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/11.0/php7.3-fpm-alpine-i386/hooks/post_test b/images/13.0/php7.3-apache/hooks/post_test similarity index 100% rename from images/11.0/php7.3-fpm-alpine-i386/hooks/post_test rename to images/13.0/php7.3-apache/hooks/post_test diff --git a/images/13.0/php7.3-apache/hooks/pre_push b/images/13.0/php7.3-apache/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/13.0/php7.3-apache/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/13.0/php7.3-apache/hooks/pre_test b/images/13.0/php7.3-apache/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/13.0/php7.3-apache/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-apache-amd64/hooks/run b/images/13.0/php7.3-apache/hooks/run similarity index 100% rename from images/13.0/php7.3-apache-amd64/hooks/run rename to images/13.0/php7.3-apache/hooks/run diff --git a/images/13.0/php7.3-apache/hooks/run_push b/images/13.0/php7.3-apache/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/13.0/php7.3-apache/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/11.0/php7.3-fpm-alpine-i386/hooks/test b/images/13.0/php7.3-apache/hooks/test similarity index 100% rename from images/11.0/php7.3-fpm-alpine-i386/hooks/test rename to images/13.0/php7.3-apache/hooks/test diff --git a/images/11.0/php7.3-fpm-alpine-i386/test/Dockerfile b/images/13.0/php7.3-apache/test/Dockerfile similarity index 100% rename from images/11.0/php7.3-fpm-alpine-i386/test/Dockerfile rename to images/13.0/php7.3-apache/test/Dockerfile diff --git a/images/11.0/php7.3-fpm-alpine-i386/test/docker_test.sh b/images/13.0/php7.3-apache/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-fpm-alpine-i386/test/docker_test.sh rename to images/13.0/php7.3-apache/test/docker_test.sh diff --git a/images/13.0/php7.3-fpm-alpine-amd64/.dockerignore b/images/13.0/php7.3-fpm-alpine-amd64/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/13.0/php7.3-fpm-alpine-amd64/.env b/images/13.0/php7.3-fpm-alpine-amd64/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/13.0/php7.3-fpm-alpine-amd64/Dockerfile b/images/13.0/php7.3-fpm-alpine-amd64/Dockerfile deleted file mode 100644 index 6c6ead93..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/Dockerfile +++ /dev/null @@ -1,160 +0,0 @@ -FROM amd64/php:7.3-fpm-alpine - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apk add --no-cache \ - bzip2 \ - icu-libs \ - imagemagick \ - libldap \ - libpq \ - libpng \ - mysql-client \ - rsync \ - ssmtp \ - shadow \ - unzip \ - zip \ - ; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - curl-dev \ - freetype-dev \ - gcc \ - g++ \ - icu-dev \ - libjpeg-turbo-dev \ - imagemagick-dev \ - imagemagick-libs \ - libmcrypt-dev \ - libpng-dev \ - libtool \ - libxml2-dev \ - libzip-dev \ - make \ - openldap-dev \ - postgresql-dev \ - postgresql-libs \ - unzip \ - zlib-dev \ - ; \ - docker-php-ext-configure ldap; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - apk --purge del .build-deps; \ - rm -rf /var/cache/apk/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=82 \ - WWW_GROUP_ID=82 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=13.0.4 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=${DOLI_VERSION} \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/13.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml b/images/13.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/13.0/php7.3-fpm-alpine-amd64/entrypoint.sh b/images/13.0/php7.3-fpm-alpine-amd64/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/13.0/php7.3-fpm-alpine-amd64/hooks/README.md b/images/13.0/php7.3-fpm-alpine-amd64/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/13.0/php7.3-fpm-alpine-amd64/hooks/build b/images/13.0/php7.3-fpm-alpine-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/13.0/php7.3-fpm-alpine-amd64/hooks/post_push b/images/13.0/php7.3-fpm-alpine-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-fpm-alpine-amd64/hooks/post_test b/images/13.0/php7.3-fpm-alpine-amd64/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-fpm-alpine-amd64/hooks/pre_push b/images/13.0/php7.3-fpm-alpine-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-fpm-alpine-amd64/hooks/pre_test b/images/13.0/php7.3-fpm-alpine-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-fpm-alpine-amd64/hooks/test b/images/13.0/php7.3-fpm-alpine-amd64/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/13.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template b/images/13.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/13.0/php7.3-fpm-alpine-amd64/test/Dockerfile b/images/13.0/php7.3-fpm-alpine-amd64/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/13.0/php7.3-fpm-alpine-amd64/test/docker_test.sh b/images/13.0/php7.3-fpm-alpine-amd64/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/13.0/php7.3-fpm-alpine-amd64/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/13.0/php7.3-fpm-alpine-i386/.dockerignore b/images/13.0/php7.3-fpm-alpine-i386/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/13.0/php7.3-fpm-alpine-i386/.dockertags b/images/13.0/php7.3-fpm-alpine-i386/.dockertags deleted file mode 100644 index 997b95b0..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -13.0.4-fpm-alpine 13.0-fpm-alpine fpm-alpine diff --git a/images/13.0/php7.3-fpm-alpine-i386/.env b/images/13.0/php7.3-fpm-alpine-i386/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/13.0/php7.3-fpm-alpine-i386/docker-compose.test.yml b/images/13.0/php7.3-fpm-alpine-i386/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/13.0/php7.3-fpm-alpine-i386/entrypoint.sh b/images/13.0/php7.3-fpm-alpine-i386/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/13.0/php7.3-fpm-alpine-i386/hooks/README.md b/images/13.0/php7.3-fpm-alpine-i386/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/13.0/php7.3-fpm-alpine-i386/hooks/build b/images/13.0/php7.3-fpm-alpine-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/13.0/php7.3-fpm-alpine-i386/hooks/post_push b/images/13.0/php7.3-fpm-alpine-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-fpm-alpine-i386/hooks/post_test b/images/13.0/php7.3-fpm-alpine-i386/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-fpm-alpine-i386/hooks/pre_push b/images/13.0/php7.3-fpm-alpine-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-fpm-alpine-i386/hooks/pre_test b/images/13.0/php7.3-fpm-alpine-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-fpm-alpine-i386/hooks/run b/images/13.0/php7.3-fpm-alpine-i386/hooks/run deleted file mode 100755 index ecd0268d..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=13.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/13.0/php7.3-fpm-alpine-i386/hooks/test b/images/13.0/php7.3-fpm-alpine-i386/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/13.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template b/images/13.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/13.0/php7.3-fpm-alpine-i386/test/Dockerfile b/images/13.0/php7.3-fpm-alpine-i386/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/13.0/php7.3-fpm-alpine-i386/test/docker_test.sh b/images/13.0/php7.3-fpm-alpine-i386/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/13.0/php7.3-fpm-alpine-i386/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/11.0/php7.3-fpm-amd64/.dockerignore b/images/13.0/php7.3-fpm-alpine/.dockerignore similarity index 100% rename from images/11.0/php7.3-fpm-amd64/.dockerignore rename to images/13.0/php7.3-fpm-alpine/.dockerignore diff --git a/images/13.0/php7.3-fpm-alpine-amd64/.dockertags b/images/13.0/php7.3-fpm-alpine/.dockertags similarity index 100% rename from images/13.0/php7.3-fpm-alpine-amd64/.dockertags rename to images/13.0/php7.3-fpm-alpine/.dockertags diff --git a/images/11.0/php7.3-fpm-amd64/.env b/images/13.0/php7.3-fpm-alpine/.env similarity index 100% rename from images/11.0/php7.3-fpm-amd64/.env rename to images/13.0/php7.3-fpm-alpine/.env diff --git a/images/13.0/php7.3-fpm-alpine-i386/Dockerfile b/images/13.0/php7.3-fpm-alpine/Dockerfile similarity index 99% rename from images/13.0/php7.3-fpm-alpine-i386/Dockerfile rename to images/13.0/php7.3-fpm-alpine/Dockerfile index 30205283..501871bb 100644 --- a/images/13.0/php7.3-fpm-alpine-i386/Dockerfile +++ b/images/13.0/php7.3-fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-fpm-alpine +FROM php:7.3-fpm-alpine # Install the packages we need # Install the PHP extensions we need diff --git a/images/13.0/php7.3-fpm-alpine/docker-compose.test.yml b/images/13.0/php7.3-fpm-alpine/docker-compose.test.yml new file mode 100644 index 00000000..9e035418 --- /dev/null +++ b/images/13.0/php7.3-fpm-alpine/docker-compose.test.yml @@ -0,0 +1,130 @@ +version: "2.3" + +volumes: + db: + data: + documents: + scripts: + +services: + # https://docs.docker.com/docker-hub/builds/automated-testing/ + sut: + build: + context: ./test + dockerfile: Dockerfile + depends_on: + - dolibarr + - dolibarr_nginx + volumes_from: + - dolibarr + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + - DOCKER_TEST_CONTAINER=dolibarr + - DOCKER_WEB_CONTAINER=dolibarr_nginx + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr: + build: + context: ./ + dockerfile: Dockerfile + args: + - VCS_REF=${VCS_REF} + - BUILD_DATE=${BUILD_DATE} + image: ${IMAGE_NAME} + container_name: dolibarr + #restart: always + depends_on: + dolibarr_db: + condition: service_healthy + links: + - dolibarr_db + expose: + - "9000" + #ports: + # - "9090:9000" + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + #- /srv/dolibarr/html:/var/www/html + #- /srv/dolibarr/documents:/var/www/documents + #- /srv/dolibarr/scripts:/var/www/scripts + environment: + - DOLI_DB_TYPE=pgsql + - DOLI_DB_HOST=dolibarr_db # same as pgsql container name + - DOLI_DB_PORT=5432 + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_db: + image: postgres:latest + container_name: dolibarr_db + #restart: always + healthcheck: + test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] + interval: 60s + retries: 5 + #start-period: 10s + mem_limit: 256M + memswap_limit: 256M + expose: + - "5432" + #ports: + # - "55432:5432" + volumes: + - db:/var/lib/postgresql/data + #- /srv/dolibarr/db:/var/lib/postgresql/data + environment: + - POSTGRES_DB=${DOLIBARR_DB_NAME} + - POSTGRES_USER=${DOLIBARR_DB_USER} + - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_nginx: + image: nginx:latest + container_name: dolibarr_nginx + #restart: always + expose: + - "80" + #ports: + # - "8080:80" + # # If you need SSL connection + # - "8443:443" + depends_on: + - dolibarr + links: + - dolibarr + volumes: + - data:/var/www/html + #- /srv/dolibarr/html:/var/www/html + - ./nginx/templates:/etc/nginx/templates + # Provide a custom nginx conf + #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + # If you need SSL connection, you can provide your own certificates + # - ./certs:/etc/letsencrypt + # - ./certs-data:/data/letsencrypt + environment: + - NGINX_HOST=localhost # set your local domain or your live domain + - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name + + dolibarr_mailer: + image: sj26/mailcatcher:latest + hostname: dolibarr_mailer + container_name: dolibarr_mailer + restart: always + expose: + - 1025 + ports: + - "1025:1025" + - "1080:1080" + # If you want, you can sync time & timezone with host + #volumes: + # - /etc/localtime:/etc/localtime:ro + # - /etc/timezone:/etc/timezone:ro diff --git a/images/11.0/php7.3-fpm-amd64/entrypoint.sh b/images/13.0/php7.3-fpm-alpine/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-fpm-amd64/entrypoint.sh rename to images/13.0/php7.3-fpm-alpine/entrypoint.sh diff --git a/images/11.0/php7.3-fpm-amd64/hooks/README.md b/images/13.0/php7.3-fpm-alpine/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/11.0/php7.3-fpm-amd64/hooks/README.md rename to images/13.0/php7.3-fpm-alpine/hooks/README.md diff --git a/images/13.0/php7.3-fpm-alpine/hooks/build b/images/13.0/php7.3-fpm-alpine/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/13.0/php7.3-fpm-alpine/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/13.0/php7.3-fpm-alpine/hooks/post_push b/images/13.0/php7.3-fpm-alpine/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/13.0/php7.3-fpm-alpine/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/11.0/php7.3-fpm-amd64/hooks/post_test b/images/13.0/php7.3-fpm-alpine/hooks/post_test similarity index 100% rename from images/11.0/php7.3-fpm-amd64/hooks/post_test rename to images/13.0/php7.3-fpm-alpine/hooks/post_test diff --git a/images/13.0/php7.3-fpm-alpine/hooks/pre_push b/images/13.0/php7.3-fpm-alpine/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/13.0/php7.3-fpm-alpine/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/13.0/php7.3-fpm-alpine/hooks/pre_test b/images/13.0/php7.3-fpm-alpine/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/13.0/php7.3-fpm-alpine/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-apache-i386/hooks/run b/images/13.0/php7.3-fpm-alpine/hooks/run similarity index 100% rename from images/13.0/php7.3-apache-i386/hooks/run rename to images/13.0/php7.3-fpm-alpine/hooks/run diff --git a/images/13.0/php7.3-fpm-alpine/hooks/run_push b/images/13.0/php7.3-fpm-alpine/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/13.0/php7.3-fpm-alpine/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/11.0/php7.3-fpm-amd64/hooks/test b/images/13.0/php7.3-fpm-alpine/hooks/test similarity index 100% rename from images/11.0/php7.3-fpm-amd64/hooks/test rename to images/13.0/php7.3-fpm-alpine/hooks/test diff --git a/images/11.0/php7.3-fpm-amd64/nginx/templates/default.conf.template b/images/13.0/php7.3-fpm-alpine/nginx/templates/default.conf.template similarity index 100% rename from images/11.0/php7.3-fpm-amd64/nginx/templates/default.conf.template rename to images/13.0/php7.3-fpm-alpine/nginx/templates/default.conf.template diff --git a/images/11.0/php7.3-fpm-amd64/test/Dockerfile b/images/13.0/php7.3-fpm-alpine/test/Dockerfile similarity index 100% rename from images/11.0/php7.3-fpm-amd64/test/Dockerfile rename to images/13.0/php7.3-fpm-alpine/test/Dockerfile diff --git a/images/11.0/php7.3-fpm-amd64/test/docker_test.sh b/images/13.0/php7.3-fpm-alpine/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-fpm-amd64/test/docker_test.sh rename to images/13.0/php7.3-fpm-alpine/test/docker_test.sh diff --git a/images/13.0/php7.3-fpm-amd64/.dockerignore b/images/13.0/php7.3-fpm-amd64/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/13.0/php7.3-fpm-amd64/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/13.0/php7.3-fpm-amd64/.env b/images/13.0/php7.3-fpm-amd64/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/13.0/php7.3-fpm-amd64/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/13.0/php7.3-fpm-amd64/Dockerfile b/images/13.0/php7.3-fpm-amd64/Dockerfile deleted file mode 100644 index c3a33f96..00000000 --- a/images/13.0/php7.3-fpm-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-fpm - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=13.0.4 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/13.0/php7.3-fpm-amd64/docker-compose.test.yml b/images/13.0/php7.3-fpm-amd64/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/13.0/php7.3-fpm-amd64/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/13.0/php7.3-fpm-amd64/entrypoint.sh b/images/13.0/php7.3-fpm-amd64/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/13.0/php7.3-fpm-amd64/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/13.0/php7.3-fpm-amd64/hooks/README.md b/images/13.0/php7.3-fpm-amd64/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/13.0/php7.3-fpm-amd64/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/13.0/php7.3-fpm-amd64/hooks/build b/images/13.0/php7.3-fpm-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/13.0/php7.3-fpm-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/13.0/php7.3-fpm-amd64/hooks/post_push b/images/13.0/php7.3-fpm-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/13.0/php7.3-fpm-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-fpm-amd64/hooks/post_test b/images/13.0/php7.3-fpm-amd64/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/13.0/php7.3-fpm-amd64/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-fpm-amd64/hooks/pre_push b/images/13.0/php7.3-fpm-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/13.0/php7.3-fpm-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-fpm-amd64/hooks/pre_test b/images/13.0/php7.3-fpm-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/13.0/php7.3-fpm-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-fpm-amd64/hooks/run b/images/13.0/php7.3-fpm-amd64/hooks/run deleted file mode 100755 index ecd0268d..00000000 --- a/images/13.0/php7.3-fpm-amd64/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=13.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/13.0/php7.3-fpm-amd64/hooks/test b/images/13.0/php7.3-fpm-amd64/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/13.0/php7.3-fpm-amd64/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/13.0/php7.3-fpm-amd64/nginx/templates/default.conf.template b/images/13.0/php7.3-fpm-amd64/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/13.0/php7.3-fpm-amd64/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/13.0/php7.3-fpm-amd64/test/Dockerfile b/images/13.0/php7.3-fpm-amd64/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/13.0/php7.3-fpm-amd64/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/13.0/php7.3-fpm-amd64/test/docker_test.sh b/images/13.0/php7.3-fpm-amd64/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/13.0/php7.3-fpm-amd64/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/13.0/php7.3-fpm-i386/.dockerignore b/images/13.0/php7.3-fpm-i386/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/13.0/php7.3-fpm-i386/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/13.0/php7.3-fpm-i386/.dockertags b/images/13.0/php7.3-fpm-i386/.dockertags deleted file mode 100644 index ff4564c1..00000000 --- a/images/13.0/php7.3-fpm-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -13.0.4-fpm 13.0-fpm fpm diff --git a/images/13.0/php7.3-fpm-i386/.env b/images/13.0/php7.3-fpm-i386/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/13.0/php7.3-fpm-i386/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/13.0/php7.3-fpm-i386/docker-compose.test.yml b/images/13.0/php7.3-fpm-i386/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/13.0/php7.3-fpm-i386/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/13.0/php7.3-fpm-i386/entrypoint.sh b/images/13.0/php7.3-fpm-i386/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/13.0/php7.3-fpm-i386/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/13.0/php7.3-fpm-i386/hooks/README.md b/images/13.0/php7.3-fpm-i386/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/13.0/php7.3-fpm-i386/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/13.0/php7.3-fpm-i386/hooks/build b/images/13.0/php7.3-fpm-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/13.0/php7.3-fpm-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/13.0/php7.3-fpm-i386/hooks/post_push b/images/13.0/php7.3-fpm-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/13.0/php7.3-fpm-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-fpm-i386/hooks/post_test b/images/13.0/php7.3-fpm-i386/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/13.0/php7.3-fpm-i386/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-fpm-i386/hooks/pre_push b/images/13.0/php7.3-fpm-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/13.0/php7.3-fpm-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/13.0/php7.3-fpm-i386/hooks/pre_test b/images/13.0/php7.3-fpm-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/13.0/php7.3-fpm-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-fpm-i386/hooks/run b/images/13.0/php7.3-fpm-i386/hooks/run deleted file mode 100755 index ecd0268d..00000000 --- a/images/13.0/php7.3-fpm-i386/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=13.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/13.0/php7.3-fpm-i386/hooks/test b/images/13.0/php7.3-fpm-i386/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/13.0/php7.3-fpm-i386/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/13.0/php7.3-fpm-i386/nginx/templates/default.conf.template b/images/13.0/php7.3-fpm-i386/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/13.0/php7.3-fpm-i386/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/13.0/php7.3-fpm-i386/test/Dockerfile b/images/13.0/php7.3-fpm-i386/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/13.0/php7.3-fpm-i386/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/13.0/php7.3-fpm-i386/test/docker_test.sh b/images/13.0/php7.3-fpm-i386/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/13.0/php7.3-fpm-i386/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/11.0/php7.3-fpm-i386/.dockerignore b/images/13.0/php7.3-fpm/.dockerignore similarity index 100% rename from images/11.0/php7.3-fpm-i386/.dockerignore rename to images/13.0/php7.3-fpm/.dockerignore diff --git a/images/13.0/php7.3-fpm-amd64/.dockertags b/images/13.0/php7.3-fpm/.dockertags similarity index 100% rename from images/13.0/php7.3-fpm-amd64/.dockertags rename to images/13.0/php7.3-fpm/.dockertags diff --git a/images/11.0/php7.3-fpm-i386/.env b/images/13.0/php7.3-fpm/.env similarity index 100% rename from images/11.0/php7.3-fpm-i386/.env rename to images/13.0/php7.3-fpm/.env diff --git a/images/13.0/php7.3-fpm-i386/Dockerfile b/images/13.0/php7.3-fpm/Dockerfile similarity index 99% rename from images/13.0/php7.3-fpm-i386/Dockerfile rename to images/13.0/php7.3-fpm/Dockerfile index 3006c580..c98bfa72 100644 --- a/images/13.0/php7.3-fpm-i386/Dockerfile +++ b/images/13.0/php7.3-fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-fpm +FROM php:7.3-fpm # Install the packages we need # Install the PHP extensions we need diff --git a/images/13.0/php7.3-fpm/docker-compose.test.yml b/images/13.0/php7.3-fpm/docker-compose.test.yml new file mode 100644 index 00000000..9e035418 --- /dev/null +++ b/images/13.0/php7.3-fpm/docker-compose.test.yml @@ -0,0 +1,130 @@ +version: "2.3" + +volumes: + db: + data: + documents: + scripts: + +services: + # https://docs.docker.com/docker-hub/builds/automated-testing/ + sut: + build: + context: ./test + dockerfile: Dockerfile + depends_on: + - dolibarr + - dolibarr_nginx + volumes_from: + - dolibarr + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + - DOCKER_TEST_CONTAINER=dolibarr + - DOCKER_WEB_CONTAINER=dolibarr_nginx + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr: + build: + context: ./ + dockerfile: Dockerfile + args: + - VCS_REF=${VCS_REF} + - BUILD_DATE=${BUILD_DATE} + image: ${IMAGE_NAME} + container_name: dolibarr + #restart: always + depends_on: + dolibarr_db: + condition: service_healthy + links: + - dolibarr_db + expose: + - "9000" + #ports: + # - "9090:9000" + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + #- /srv/dolibarr/html:/var/www/html + #- /srv/dolibarr/documents:/var/www/documents + #- /srv/dolibarr/scripts:/var/www/scripts + environment: + - DOLI_DB_TYPE=pgsql + - DOLI_DB_HOST=dolibarr_db # same as pgsql container name + - DOLI_DB_PORT=5432 + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_db: + image: postgres:latest + container_name: dolibarr_db + #restart: always + healthcheck: + test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] + interval: 60s + retries: 5 + #start-period: 10s + mem_limit: 256M + memswap_limit: 256M + expose: + - "5432" + #ports: + # - "55432:5432" + volumes: + - db:/var/lib/postgresql/data + #- /srv/dolibarr/db:/var/lib/postgresql/data + environment: + - POSTGRES_DB=${DOLIBARR_DB_NAME} + - POSTGRES_USER=${DOLIBARR_DB_USER} + - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_nginx: + image: nginx:latest + container_name: dolibarr_nginx + #restart: always + expose: + - "80" + #ports: + # - "8080:80" + # # If you need SSL connection + # - "8443:443" + depends_on: + - dolibarr + links: + - dolibarr + volumes: + - data:/var/www/html + #- /srv/dolibarr/html:/var/www/html + - ./nginx/templates:/etc/nginx/templates + # Provide a custom nginx conf + #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + # If you need SSL connection, you can provide your own certificates + # - ./certs:/etc/letsencrypt + # - ./certs-data:/data/letsencrypt + environment: + - NGINX_HOST=localhost # set your local domain or your live domain + - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name + + dolibarr_mailer: + image: sj26/mailcatcher:latest + hostname: dolibarr_mailer + container_name: dolibarr_mailer + restart: always + expose: + - 1025 + ports: + - "1025:1025" + - "1080:1080" + # If you want, you can sync time & timezone with host + #volumes: + # - /etc/localtime:/etc/localtime:ro + # - /etc/timezone:/etc/timezone:ro diff --git a/images/11.0/php7.3-fpm-i386/entrypoint.sh b/images/13.0/php7.3-fpm/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-fpm-i386/entrypoint.sh rename to images/13.0/php7.3-fpm/entrypoint.sh diff --git a/images/11.0/php7.3-fpm-i386/hooks/README.md b/images/13.0/php7.3-fpm/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/11.0/php7.3-fpm-i386/hooks/README.md rename to images/13.0/php7.3-fpm/hooks/README.md diff --git a/images/13.0/php7.3-fpm/hooks/build b/images/13.0/php7.3-fpm/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/13.0/php7.3-fpm/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/13.0/php7.3-fpm/hooks/post_push b/images/13.0/php7.3-fpm/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/13.0/php7.3-fpm/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/11.0/php7.3-fpm-i386/hooks/post_test b/images/13.0/php7.3-fpm/hooks/post_test similarity index 100% rename from images/11.0/php7.3-fpm-i386/hooks/post_test rename to images/13.0/php7.3-fpm/hooks/post_test diff --git a/images/13.0/php7.3-fpm/hooks/pre_push b/images/13.0/php7.3-fpm/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/13.0/php7.3-fpm/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/13.0/php7.3-fpm/hooks/pre_test b/images/13.0/php7.3-fpm/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/13.0/php7.3-fpm/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/13.0/php7.3-fpm-alpine-amd64/hooks/run b/images/13.0/php7.3-fpm/hooks/run similarity index 100% rename from images/13.0/php7.3-fpm-alpine-amd64/hooks/run rename to images/13.0/php7.3-fpm/hooks/run diff --git a/images/13.0/php7.3-fpm/hooks/run_push b/images/13.0/php7.3-fpm/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/13.0/php7.3-fpm/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/11.0/php7.3-fpm-i386/hooks/test b/images/13.0/php7.3-fpm/hooks/test similarity index 100% rename from images/11.0/php7.3-fpm-i386/hooks/test rename to images/13.0/php7.3-fpm/hooks/test diff --git a/images/11.0/php7.3-fpm-i386/nginx/templates/default.conf.template b/images/13.0/php7.3-fpm/nginx/templates/default.conf.template similarity index 100% rename from images/11.0/php7.3-fpm-i386/nginx/templates/default.conf.template rename to images/13.0/php7.3-fpm/nginx/templates/default.conf.template diff --git a/images/11.0/php7.3-fpm-i386/test/Dockerfile b/images/13.0/php7.3-fpm/test/Dockerfile similarity index 100% rename from images/11.0/php7.3-fpm-i386/test/Dockerfile rename to images/13.0/php7.3-fpm/test/Dockerfile diff --git a/images/11.0/php7.3-fpm-i386/test/docker_test.sh b/images/13.0/php7.3-fpm/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/11.0/php7.3-fpm-i386/test/docker_test.sh rename to images/13.0/php7.3-fpm/test/docker_test.sh diff --git a/images/14.0/php7.3-apache-amd64/.dockerignore b/images/14.0/php7.3-apache-amd64/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/14.0/php7.3-apache-amd64/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/14.0/php7.3-apache-amd64/.dockertags b/images/14.0/php7.3-apache-amd64/.dockertags deleted file mode 100644 index 14655d13..00000000 --- a/images/14.0/php7.3-apache-amd64/.dockertags +++ /dev/null @@ -1 +0,0 @@ -14.0.1-apache 14.0-apache 14.0.1 14.0 diff --git a/images/14.0/php7.3-apache-amd64/.env b/images/14.0/php7.3-apache-amd64/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/14.0/php7.3-apache-amd64/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/14.0/php7.3-apache-amd64/Dockerfile b/images/14.0/php7.3-apache-amd64/Dockerfile deleted file mode 100644 index 7a8f2861..00000000 --- a/images/14.0/php7.3-apache-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-apache - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=14.0.1 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/14.0/php7.3-apache-amd64/docker-compose.test.yml b/images/14.0/php7.3-apache-amd64/docker-compose.test.yml deleted file mode 100644 index d4728e02..00000000 --- a/images/14.0/php7.3-apache-amd64/docker-compose.test.yml +++ /dev/null @@ -1,109 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr_db - - dolibarr - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "80" - #ports: - # - "8080:80" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_HOST=dolibarr_db # same as mysql container name - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: mariadb:latest - container_name: dolibarr_db - #restart: always - command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE - healthcheck: - test: - [ - "CMD", - "mysqladmin", - "ping", - "-h", - "localhost", - "--password=${DOLIBARR_DB_ROOT_PWD}", - ] - timeout: 10s - retries: 5 - expose: - - "3306" - #ports: - # - "33306:3306" - volumes: - - db:/var/lib/mysql - #- /srv/dolibarr/db:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=${DOLIBARR_DB_ROOT_PWD} - - MYSQL_DATABASE=${DOLIBARR_DB_NAME} - - MYSQL_USER=${DOLIBARR_DB_USER} - - MYSQL_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/14.0/php7.3-apache-amd64/entrypoint.sh b/images/14.0/php7.3-apache-amd64/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/14.0/php7.3-apache-amd64/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/14.0/php7.3-apache-amd64/hooks/README.md b/images/14.0/php7.3-apache-amd64/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/14.0/php7.3-apache-amd64/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/14.0/php7.3-apache-amd64/hooks/build b/images/14.0/php7.3-apache-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/14.0/php7.3-apache-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/14.0/php7.3-apache-amd64/hooks/post_push b/images/14.0/php7.3-apache-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/14.0/php7.3-apache-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-apache-amd64/hooks/post_test b/images/14.0/php7.3-apache-amd64/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/14.0/php7.3-apache-amd64/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-apache-amd64/hooks/pre_push b/images/14.0/php7.3-apache-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/14.0/php7.3-apache-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-apache-amd64/hooks/pre_test b/images/14.0/php7.3-apache-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/14.0/php7.3-apache-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-apache-amd64/hooks/test b/images/14.0/php7.3-apache-amd64/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/14.0/php7.3-apache-amd64/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/14.0/php7.3-apache-amd64/test/Dockerfile b/images/14.0/php7.3-apache-amd64/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/14.0/php7.3-apache-amd64/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/14.0/php7.3-apache-amd64/test/docker_test.sh b/images/14.0/php7.3-apache-amd64/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/14.0/php7.3-apache-amd64/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/14.0/php7.3-apache-i386/.dockerignore b/images/14.0/php7.3-apache-i386/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/14.0/php7.3-apache-i386/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/14.0/php7.3-apache-i386/.dockertags b/images/14.0/php7.3-apache-i386/.dockertags deleted file mode 100644 index 14655d13..00000000 --- a/images/14.0/php7.3-apache-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -14.0.1-apache 14.0-apache 14.0.1 14.0 diff --git a/images/14.0/php7.3-apache-i386/.env b/images/14.0/php7.3-apache-i386/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/14.0/php7.3-apache-i386/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/14.0/php7.3-apache-i386/Dockerfile b/images/14.0/php7.3-apache-i386/Dockerfile deleted file mode 100644 index 4428a2ec..00000000 --- a/images/14.0/php7.3-apache-i386/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM i386/php:7.3-apache - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=14.0.1 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/14.0/php7.3-apache-i386/docker-compose.test.yml b/images/14.0/php7.3-apache-i386/docker-compose.test.yml deleted file mode 100644 index d4728e02..00000000 --- a/images/14.0/php7.3-apache-i386/docker-compose.test.yml +++ /dev/null @@ -1,109 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr_db - - dolibarr - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "80" - #ports: - # - "8080:80" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_HOST=dolibarr_db # same as mysql container name - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: mariadb:latest - container_name: dolibarr_db - #restart: always - command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE - healthcheck: - test: - [ - "CMD", - "mysqladmin", - "ping", - "-h", - "localhost", - "--password=${DOLIBARR_DB_ROOT_PWD}", - ] - timeout: 10s - retries: 5 - expose: - - "3306" - #ports: - # - "33306:3306" - volumes: - - db:/var/lib/mysql - #- /srv/dolibarr/db:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=${DOLIBARR_DB_ROOT_PWD} - - MYSQL_DATABASE=${DOLIBARR_DB_NAME} - - MYSQL_USER=${DOLIBARR_DB_USER} - - MYSQL_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/14.0/php7.3-apache-i386/entrypoint.sh b/images/14.0/php7.3-apache-i386/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/14.0/php7.3-apache-i386/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/14.0/php7.3-apache-i386/hooks/README.md b/images/14.0/php7.3-apache-i386/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/14.0/php7.3-apache-i386/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/14.0/php7.3-apache-i386/hooks/build b/images/14.0/php7.3-apache-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/14.0/php7.3-apache-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/14.0/php7.3-apache-i386/hooks/post_push b/images/14.0/php7.3-apache-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/14.0/php7.3-apache-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-apache-i386/hooks/post_test b/images/14.0/php7.3-apache-i386/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/14.0/php7.3-apache-i386/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-apache-i386/hooks/pre_push b/images/14.0/php7.3-apache-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/14.0/php7.3-apache-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-apache-i386/hooks/pre_test b/images/14.0/php7.3-apache-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/14.0/php7.3-apache-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-apache-i386/hooks/test b/images/14.0/php7.3-apache-i386/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/14.0/php7.3-apache-i386/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/14.0/php7.3-apache-i386/test/Dockerfile b/images/14.0/php7.3-apache-i386/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/14.0/php7.3-apache-i386/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/14.0/php7.3-apache-i386/test/docker_test.sh b/images/14.0/php7.3-apache-i386/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/14.0/php7.3-apache-i386/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/12.0/php7.3-apache-amd64/.dockerignore b/images/14.0/php7.3-apache/.dockerignore similarity index 100% rename from images/12.0/php7.3-apache-amd64/.dockerignore rename to images/14.0/php7.3-apache/.dockerignore diff --git a/images/14.0/php7.3-apache/.dockertags b/images/14.0/php7.3-apache/.dockertags new file mode 100644 index 00000000..ea93fffa --- /dev/null +++ b/images/14.0/php7.3-apache/.dockertags @@ -0,0 +1 @@ +14.0.2-apache 14.0-apache 14.0.2 14.0 diff --git a/images/12.0/php7.3-apache-amd64/.env b/images/14.0/php7.3-apache/.env similarity index 100% rename from images/12.0/php7.3-apache-amd64/.env rename to images/14.0/php7.3-apache/.env diff --git a/images/14.0/php7.3-apache/Dockerfile b/images/14.0/php7.3-apache/Dockerfile new file mode 100644 index 00000000..109e6870 --- /dev/null +++ b/images/14.0/php7.3-apache/Dockerfile @@ -0,0 +1,150 @@ +FROM php:7.3-apache + +# Install the packages we need +# Install the PHP extensions we need +# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries +# Prepare folders +RUN set -ex; \ + apt-get update -q; \ + apt-get install -y --no-install-recommends \ + bzip2 \ + default-mysql-client \ + cron \ + rsync \ + sendmail \ + unzip \ + zip \ + ; \ + apt-get install -y --no-install-recommends \ + g++ \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmagickcore-dev \ + libmagickwand-dev \ + libmcrypt-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libzip-dev \ + unzip \ + zlib1g-dev \ + ; \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure intl; \ + docker-php-ext-configure zip --with-libzip; \ + docker-php-ext-install -j "$(nproc)" \ + calendar \ + gd \ + intl \ + ldap \ + mbstring \ + mysqli \ + pdo \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + soap \ + zip \ + ; \ + pecl install imagick; \ + docker-php-ext-enable imagick; \ + rm -rf /var/lib/apt/lists/*; \ + mkdir -p /var/www/documents; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html /var/www/documents /var/www/scripts + +# Runtime env var +ENV DOLI_AUTO_CONFIGURE=1 \ + DOLI_DB_TYPE=mysqli \ + DOLI_DB_HOST= \ + DOLI_DB_PORT=3306 \ + DOLI_DB_USER=dolibarr \ + DOLI_DB_PASSWORD='' \ + DOLI_DB_NAME=dolibarr \ + DOLI_DB_PREFIX=llx_ \ + DOLI_DB_CHARACTER_SET=utf8 \ + DOLI_DB_COLLATION=utf8_unicode_ci \ + DOLI_DB_ROOT_LOGIN='' \ + DOLI_DB_ROOT_PASSWORD='' \ + DOLI_ADMIN_LOGIN=admin \ + DOLI_MODULES='' \ + DOLI_URL_ROOT='http://localhost' \ + DOLI_AUTH=dolibarr \ + DOLI_LDAP_HOST= \ + DOLI_LDAP_PORT=389 \ + DOLI_LDAP_VERSION=3 \ + DOLI_LDAP_SERVERTYPE=openldap \ + DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ + DOLI_LDAP_DN='' \ + DOLI_LDAP_FILTER='' \ + DOLI_LDAP_ADMIN_LOGIN='' \ + DOLI_LDAP_ADMIN_PASS='' \ + DOLI_LDAP_DEBUG=false \ + DOLI_HTTPS=0 \ + DOLI_PROD=0 \ + DOLI_NO_CSRF_CHECK=0 \ + WWW_USER_ID=33 \ + WWW_GROUP_ID=33 \ + PHP_INI_DATE_TIMEZONE='UTC' \ + PHP_MEMORY_LIMIT=256M \ + PHP_MAX_UPLOAD=20M \ + PHP_MAX_EXECUTION_TIME=300 + +# Build time env var +ARG DOLI_VERSION=14.0.2 + +# Get Dolibarr +ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip + +# Install Dolibarr from tag archive +RUN set -ex; \ + mkdir -p /tmp/dolibarr; \ + unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ + rm /tmp/dolibarr.zip; \ + mkdir -p /usr/src/dolibarr; \ + cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ + rm -rf /tmp/dolibarr; \ + chmod +x /usr/src/dolibarr/scripts/*; \ + echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version + +COPY entrypoint.sh / +RUN set -ex; \ + chmod 755 /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["apache2-foreground"] + +# Arguments to label built container +ARG VCS_REF +ARG BUILD_DATE + +# Container labels (http://label-schema.org/) +# Container annotations (https://github.com/opencontainers/image-spec) +LABEL maintainer="Monogramm maintainers " \ + product="Dolibarr" \ + version=${DOLI_VERSION} \ + org.label-schema.vcs-ref=${VCS_REF} \ + org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ + org.label-schema.build-date=${BUILD_DATE} \ + org.label-schema.name="Dolibarr" \ + org.label-schema.description="Open Source ERP & CRM for Business" \ + org.label-schema.url="https://www.dolibarr.org/" \ + org.label-schema.vendor="Dolibarr" \ + org.label-schema.version=$DOLI_VERSION \ + org.label-schema.schema-version="1.0" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.title="Dolibarr" \ + org.opencontainers.image.description="Open Source ERP & CRM for Business" \ + org.opencontainers.image.url="https://www.dolibarr.org/" \ + org.opencontainers.image.vendor="Dolibarr" \ + org.opencontainers.image.version=${DOLI_VERSION} \ + org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/14.0/php7.3-apache/docker-compose.test.yml b/images/14.0/php7.3-apache/docker-compose.test.yml new file mode 100644 index 00000000..ec96a5de --- /dev/null +++ b/images/14.0/php7.3-apache/docker-compose.test.yml @@ -0,0 +1,108 @@ +version: "2.3" + +volumes: + db: + data: + documents: + scripts: + +services: + # https://docs.docker.com/docker-hub/builds/automated-testing/ + sut: + build: + context: ./test + dockerfile: Dockerfile + depends_on: + - dolibarr_db + - dolibarr + volumes_from: + - dolibarr + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + - DOCKER_TEST_CONTAINER=dolibarr + - DOCKER_WEB_CONTAINER=dolibarr + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr: + build: + context: ./ + dockerfile: Dockerfile + args: + - VCS_REF=${VCS_REF} + - BUILD_DATE=${BUILD_DATE} + image: ${IMAGE_NAME} + container_name: dolibarr + #restart: always + depends_on: + dolibarr_db: + condition: service_healthy + links: + - dolibarr_db + expose: + - "80" + #ports: + # - "8080:80" + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + #- /srv/dolibarr/html:/var/www/html + #- /srv/dolibarr/documents:/var/www/documents + #- /srv/dolibarr/scripts:/var/www/scripts + environment: + - DOLI_DB_HOST=dolibarr_db # same as mysql container name + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_db: + image: mariadb:latest + container_name: dolibarr_db + #restart: always + command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE + healthcheck: + test: + [ + "CMD", + "mysqladmin", + "ping", + "-h", + "localhost", + "--password=${DOLIBARR_DB_ROOT_PWD}", + ] + timeout: 10s + retries: 5 + expose: + - "3306" + #ports: + # - "33306:3306" + volumes: + - db:/var/lib/mysql + #- /srv/dolibarr/db:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=${DOLIBARR_DB_ROOT_PWD} + - MYSQL_DATABASE=${DOLIBARR_DB_NAME} + - MYSQL_USER=${DOLIBARR_DB_USER} + - MYSQL_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_mailer: + image: sj26/mailcatcher:latest + hostname: dolibarr_mailer + container_name: dolibarr_mailer + restart: always + expose: + - 1025 + ports: + - "1025:1025" + - "1080:1080" + # If you want, you can sync time & timezone with host + #volumes: + # - /etc/localtime:/etc/localtime:ro + # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-apache-amd64/entrypoint.sh b/images/14.0/php7.3-apache/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-apache-amd64/entrypoint.sh rename to images/14.0/php7.3-apache/entrypoint.sh diff --git a/images/12.0/php7.3-apache-amd64/hooks/README.md b/images/14.0/php7.3-apache/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/12.0/php7.3-apache-amd64/hooks/README.md rename to images/14.0/php7.3-apache/hooks/README.md diff --git a/images/14.0/php7.3-apache/hooks/build b/images/14.0/php7.3-apache/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/14.0/php7.3-apache/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/14.0/php7.3-apache/hooks/post_push b/images/14.0/php7.3-apache/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/14.0/php7.3-apache/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/12.0/php7.3-apache-amd64/hooks/post_test b/images/14.0/php7.3-apache/hooks/post_test similarity index 100% rename from images/12.0/php7.3-apache-amd64/hooks/post_test rename to images/14.0/php7.3-apache/hooks/post_test diff --git a/images/14.0/php7.3-apache/hooks/pre_push b/images/14.0/php7.3-apache/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/14.0/php7.3-apache/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/14.0/php7.3-apache/hooks/pre_test b/images/14.0/php7.3-apache/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/14.0/php7.3-apache/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-apache-amd64/hooks/run b/images/14.0/php7.3-apache/hooks/run similarity index 100% rename from images/14.0/php7.3-apache-amd64/hooks/run rename to images/14.0/php7.3-apache/hooks/run diff --git a/images/14.0/php7.3-apache/hooks/run_push b/images/14.0/php7.3-apache/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/14.0/php7.3-apache/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/12.0/php7.3-apache-amd64/hooks/test b/images/14.0/php7.3-apache/hooks/test similarity index 100% rename from images/12.0/php7.3-apache-amd64/hooks/test rename to images/14.0/php7.3-apache/hooks/test diff --git a/images/12.0/php7.3-apache-amd64/test/Dockerfile b/images/14.0/php7.3-apache/test/Dockerfile similarity index 100% rename from images/12.0/php7.3-apache-amd64/test/Dockerfile rename to images/14.0/php7.3-apache/test/Dockerfile diff --git a/images/12.0/php7.3-apache-amd64/test/docker_test.sh b/images/14.0/php7.3-apache/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-apache-amd64/test/docker_test.sh rename to images/14.0/php7.3-apache/test/docker_test.sh diff --git a/images/14.0/php7.3-fpm-alpine-amd64/.dockerignore b/images/14.0/php7.3-fpm-alpine-amd64/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/14.0/php7.3-fpm-alpine-amd64/.dockertags b/images/14.0/php7.3-fpm-alpine-amd64/.dockertags deleted file mode 100644 index 1dc11e37..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/.dockertags +++ /dev/null @@ -1 +0,0 @@ -14.0.1-fpm-alpine 14.0-fpm-alpine diff --git a/images/14.0/php7.3-fpm-alpine-amd64/.env b/images/14.0/php7.3-fpm-alpine-amd64/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/14.0/php7.3-fpm-alpine-amd64/Dockerfile b/images/14.0/php7.3-fpm-alpine-amd64/Dockerfile deleted file mode 100644 index 5441cf28..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/Dockerfile +++ /dev/null @@ -1,160 +0,0 @@ -FROM amd64/php:7.3-fpm-alpine - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apk add --no-cache \ - bzip2 \ - icu-libs \ - imagemagick \ - libldap \ - libpq \ - libpng \ - mysql-client \ - rsync \ - ssmtp \ - shadow \ - unzip \ - zip \ - ; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - curl-dev \ - freetype-dev \ - gcc \ - g++ \ - icu-dev \ - libjpeg-turbo-dev \ - imagemagick-dev \ - imagemagick-libs \ - libmcrypt-dev \ - libpng-dev \ - libtool \ - libxml2-dev \ - libzip-dev \ - make \ - openldap-dev \ - postgresql-dev \ - postgresql-libs \ - unzip \ - zlib-dev \ - ; \ - docker-php-ext-configure ldap; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - apk --purge del .build-deps; \ - rm -rf /var/cache/apk/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=82 \ - WWW_GROUP_ID=82 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=14.0.1 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=${DOLI_VERSION} \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/14.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml b/images/14.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/14.0/php7.3-fpm-alpine-amd64/entrypoint.sh b/images/14.0/php7.3-fpm-alpine-amd64/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/14.0/php7.3-fpm-alpine-amd64/hooks/README.md b/images/14.0/php7.3-fpm-alpine-amd64/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/14.0/php7.3-fpm-alpine-amd64/hooks/build b/images/14.0/php7.3-fpm-alpine-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/14.0/php7.3-fpm-alpine-amd64/hooks/post_push b/images/14.0/php7.3-fpm-alpine-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-fpm-alpine-amd64/hooks/post_test b/images/14.0/php7.3-fpm-alpine-amd64/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-fpm-alpine-amd64/hooks/pre_push b/images/14.0/php7.3-fpm-alpine-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-fpm-alpine-amd64/hooks/pre_test b/images/14.0/php7.3-fpm-alpine-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-fpm-alpine-amd64/hooks/test b/images/14.0/php7.3-fpm-alpine-amd64/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/14.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template b/images/14.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/14.0/php7.3-fpm-alpine-amd64/test/Dockerfile b/images/14.0/php7.3-fpm-alpine-amd64/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/14.0/php7.3-fpm-alpine-amd64/test/docker_test.sh b/images/14.0/php7.3-fpm-alpine-amd64/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/14.0/php7.3-fpm-alpine-amd64/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/14.0/php7.3-fpm-alpine-i386/.dockerignore b/images/14.0/php7.3-fpm-alpine-i386/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/14.0/php7.3-fpm-alpine-i386/.dockertags b/images/14.0/php7.3-fpm-alpine-i386/.dockertags deleted file mode 100644 index 1dc11e37..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -14.0.1-fpm-alpine 14.0-fpm-alpine diff --git a/images/14.0/php7.3-fpm-alpine-i386/.env b/images/14.0/php7.3-fpm-alpine-i386/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/14.0/php7.3-fpm-alpine-i386/Dockerfile b/images/14.0/php7.3-fpm-alpine-i386/Dockerfile deleted file mode 100644 index 4ee83082..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/Dockerfile +++ /dev/null @@ -1,160 +0,0 @@ -FROM i386/php:7.3-fpm-alpine - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apk add --no-cache \ - bzip2 \ - icu-libs \ - imagemagick \ - libldap \ - libpq \ - libpng \ - mysql-client \ - rsync \ - ssmtp \ - shadow \ - unzip \ - zip \ - ; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - curl-dev \ - freetype-dev \ - gcc \ - g++ \ - icu-dev \ - libjpeg-turbo-dev \ - imagemagick-dev \ - imagemagick-libs \ - libmcrypt-dev \ - libpng-dev \ - libtool \ - libxml2-dev \ - libzip-dev \ - make \ - openldap-dev \ - postgresql-dev \ - postgresql-libs \ - unzip \ - zlib-dev \ - ; \ - docker-php-ext-configure ldap; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - apk --purge del .build-deps; \ - rm -rf /var/cache/apk/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=82 \ - WWW_GROUP_ID=82 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=14.0.1 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=${DOLI_VERSION} \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/14.0/php7.3-fpm-alpine-i386/docker-compose.test.yml b/images/14.0/php7.3-fpm-alpine-i386/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/14.0/php7.3-fpm-alpine-i386/entrypoint.sh b/images/14.0/php7.3-fpm-alpine-i386/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/14.0/php7.3-fpm-alpine-i386/hooks/README.md b/images/14.0/php7.3-fpm-alpine-i386/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/14.0/php7.3-fpm-alpine-i386/hooks/build b/images/14.0/php7.3-fpm-alpine-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/14.0/php7.3-fpm-alpine-i386/hooks/post_push b/images/14.0/php7.3-fpm-alpine-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-fpm-alpine-i386/hooks/post_test b/images/14.0/php7.3-fpm-alpine-i386/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-fpm-alpine-i386/hooks/pre_push b/images/14.0/php7.3-fpm-alpine-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-fpm-alpine-i386/hooks/pre_test b/images/14.0/php7.3-fpm-alpine-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-fpm-alpine-i386/hooks/run b/images/14.0/php7.3-fpm-alpine-i386/hooks/run deleted file mode 100755 index 6fdb47d9..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=14.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/14.0/php7.3-fpm-alpine-i386/hooks/test b/images/14.0/php7.3-fpm-alpine-i386/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/14.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template b/images/14.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/14.0/php7.3-fpm-alpine-i386/test/Dockerfile b/images/14.0/php7.3-fpm-alpine-i386/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/14.0/php7.3-fpm-alpine-i386/test/docker_test.sh b/images/14.0/php7.3-fpm-alpine-i386/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/14.0/php7.3-fpm-alpine-i386/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/12.0/php7.3-apache-i386/.dockerignore b/images/14.0/php7.3-fpm-alpine/.dockerignore similarity index 100% rename from images/12.0/php7.3-apache-i386/.dockerignore rename to images/14.0/php7.3-fpm-alpine/.dockerignore diff --git a/images/14.0/php7.3-fpm-alpine/.dockertags b/images/14.0/php7.3-fpm-alpine/.dockertags new file mode 100644 index 00000000..dff3ec2e --- /dev/null +++ b/images/14.0/php7.3-fpm-alpine/.dockertags @@ -0,0 +1 @@ +14.0.2-fpm-alpine 14.0-fpm-alpine diff --git a/images/12.0/php7.3-apache-i386/.env b/images/14.0/php7.3-fpm-alpine/.env similarity index 100% rename from images/12.0/php7.3-apache-i386/.env rename to images/14.0/php7.3-fpm-alpine/.env diff --git a/images/14.0/php7.3-fpm-alpine/Dockerfile b/images/14.0/php7.3-fpm-alpine/Dockerfile new file mode 100644 index 00000000..3fd97db6 --- /dev/null +++ b/images/14.0/php7.3-fpm-alpine/Dockerfile @@ -0,0 +1,160 @@ +FROM php:7.3-fpm-alpine + +# Install the packages we need +# Install the PHP extensions we need +# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries +# Prepare folders +RUN set -ex; \ + apk add --no-cache \ + bzip2 \ + icu-libs \ + imagemagick \ + libldap \ + libpq \ + libpng \ + mysql-client \ + rsync \ + ssmtp \ + shadow \ + unzip \ + zip \ + ; \ + apk add --no-cache --virtual .build-deps \ + $PHPIZE_DEPS \ + autoconf \ + curl-dev \ + freetype-dev \ + gcc \ + g++ \ + icu-dev \ + libjpeg-turbo-dev \ + imagemagick-dev \ + imagemagick-libs \ + libmcrypt-dev \ + libpng-dev \ + libtool \ + libxml2-dev \ + libzip-dev \ + make \ + openldap-dev \ + postgresql-dev \ + postgresql-libs \ + unzip \ + zlib-dev \ + ; \ + docker-php-ext-configure ldap; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure intl; \ + docker-php-ext-configure zip; \ + docker-php-ext-install -j "$(nproc)" \ + calendar \ + gd \ + intl \ + ldap \ + mbstring \ + mysqli \ + pdo \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + soap \ + zip \ + ; \ + pecl install imagick; \ + docker-php-ext-enable imagick; \ + apk --purge del .build-deps; \ + rm -rf /var/cache/apk/*; \ + mkdir -p /var/www/documents; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html /var/www/documents /var/www/scripts + +# Runtime env var +ENV DOLI_AUTO_CONFIGURE=1 \ + DOLI_DB_TYPE=mysqli \ + DOLI_DB_HOST= \ + DOLI_DB_PORT=3306 \ + DOLI_DB_USER=dolibarr \ + DOLI_DB_PASSWORD='' \ + DOLI_DB_NAME=dolibarr \ + DOLI_DB_PREFIX=llx_ \ + DOLI_DB_CHARACTER_SET=utf8 \ + DOLI_DB_COLLATION=utf8_unicode_ci \ + DOLI_DB_ROOT_LOGIN='' \ + DOLI_DB_ROOT_PASSWORD='' \ + DOLI_ADMIN_LOGIN=admin \ + DOLI_MODULES='' \ + DOLI_URL_ROOT='http://localhost' \ + DOLI_AUTH=dolibarr \ + DOLI_LDAP_HOST= \ + DOLI_LDAP_PORT=389 \ + DOLI_LDAP_VERSION=3 \ + DOLI_LDAP_SERVERTYPE=openldap \ + DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ + DOLI_LDAP_DN='' \ + DOLI_LDAP_FILTER='' \ + DOLI_LDAP_ADMIN_LOGIN='' \ + DOLI_LDAP_ADMIN_PASS='' \ + DOLI_LDAP_DEBUG=false \ + DOLI_HTTPS=0 \ + DOLI_PROD=0 \ + DOLI_NO_CSRF_CHECK=0 \ + WWW_USER_ID=82 \ + WWW_GROUP_ID=82 \ + PHP_INI_DATE_TIMEZONE='UTC' \ + PHP_MEMORY_LIMIT=256M \ + PHP_MAX_UPLOAD=20M \ + PHP_MAX_EXECUTION_TIME=300 + +# Build time env var +ARG DOLI_VERSION=14.0.2 + +# Get Dolibarr +ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip + +# Install Dolibarr from tag archive +RUN set -ex; \ + mkdir -p /tmp/dolibarr; \ + unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ + rm /tmp/dolibarr.zip; \ + mkdir -p /usr/src/dolibarr; \ + cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ + rm -rf /tmp/dolibarr; \ + chmod +x /usr/src/dolibarr/scripts/*; \ + echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version + +COPY entrypoint.sh / +RUN set -ex; \ + chmod 755 /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] + +# Arguments to label built container +ARG VCS_REF +ARG BUILD_DATE + +# Container labels (http://label-schema.org/) +# Container annotations (https://github.com/opencontainers/image-spec) +LABEL maintainer="Monogramm maintainers " \ + product="Dolibarr" \ + version=${DOLI_VERSION} \ + org.label-schema.vcs-ref=${VCS_REF} \ + org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name="Dolibarr" \ + org.label-schema.description="Open Source ERP & CRM for Business" \ + org.label-schema.url="https://www.dolibarr.org/" \ + org.label-schema.vendor="Dolibarr" \ + org.label-schema.version=${DOLI_VERSION} \ + org.label-schema.schema-version="1.0" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.title="Dolibarr" \ + org.opencontainers.image.description="Open Source ERP & CRM for Business" \ + org.opencontainers.image.url="https://www.dolibarr.org/" \ + org.opencontainers.image.vendor="Dolibarr" \ + org.opencontainers.image.version=${DOLI_VERSION} \ + org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/14.0/php7.3-fpm-alpine/docker-compose.test.yml b/images/14.0/php7.3-fpm-alpine/docker-compose.test.yml new file mode 100644 index 00000000..9e035418 --- /dev/null +++ b/images/14.0/php7.3-fpm-alpine/docker-compose.test.yml @@ -0,0 +1,130 @@ +version: "2.3" + +volumes: + db: + data: + documents: + scripts: + +services: + # https://docs.docker.com/docker-hub/builds/automated-testing/ + sut: + build: + context: ./test + dockerfile: Dockerfile + depends_on: + - dolibarr + - dolibarr_nginx + volumes_from: + - dolibarr + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + - DOCKER_TEST_CONTAINER=dolibarr + - DOCKER_WEB_CONTAINER=dolibarr_nginx + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr: + build: + context: ./ + dockerfile: Dockerfile + args: + - VCS_REF=${VCS_REF} + - BUILD_DATE=${BUILD_DATE} + image: ${IMAGE_NAME} + container_name: dolibarr + #restart: always + depends_on: + dolibarr_db: + condition: service_healthy + links: + - dolibarr_db + expose: + - "9000" + #ports: + # - "9090:9000" + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + #- /srv/dolibarr/html:/var/www/html + #- /srv/dolibarr/documents:/var/www/documents + #- /srv/dolibarr/scripts:/var/www/scripts + environment: + - DOLI_DB_TYPE=pgsql + - DOLI_DB_HOST=dolibarr_db # same as pgsql container name + - DOLI_DB_PORT=5432 + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_db: + image: postgres:latest + container_name: dolibarr_db + #restart: always + healthcheck: + test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] + interval: 60s + retries: 5 + #start-period: 10s + mem_limit: 256M + memswap_limit: 256M + expose: + - "5432" + #ports: + # - "55432:5432" + volumes: + - db:/var/lib/postgresql/data + #- /srv/dolibarr/db:/var/lib/postgresql/data + environment: + - POSTGRES_DB=${DOLIBARR_DB_NAME} + - POSTGRES_USER=${DOLIBARR_DB_USER} + - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_nginx: + image: nginx:latest + container_name: dolibarr_nginx + #restart: always + expose: + - "80" + #ports: + # - "8080:80" + # # If you need SSL connection + # - "8443:443" + depends_on: + - dolibarr + links: + - dolibarr + volumes: + - data:/var/www/html + #- /srv/dolibarr/html:/var/www/html + - ./nginx/templates:/etc/nginx/templates + # Provide a custom nginx conf + #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + # If you need SSL connection, you can provide your own certificates + # - ./certs:/etc/letsencrypt + # - ./certs-data:/data/letsencrypt + environment: + - NGINX_HOST=localhost # set your local domain or your live domain + - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name + + dolibarr_mailer: + image: sj26/mailcatcher:latest + hostname: dolibarr_mailer + container_name: dolibarr_mailer + restart: always + expose: + - 1025 + ports: + - "1025:1025" + - "1080:1080" + # If you want, you can sync time & timezone with host + #volumes: + # - /etc/localtime:/etc/localtime:ro + # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-apache-i386/entrypoint.sh b/images/14.0/php7.3-fpm-alpine/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-apache-i386/entrypoint.sh rename to images/14.0/php7.3-fpm-alpine/entrypoint.sh diff --git a/images/12.0/php7.3-apache-i386/hooks/README.md b/images/14.0/php7.3-fpm-alpine/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/12.0/php7.3-apache-i386/hooks/README.md rename to images/14.0/php7.3-fpm-alpine/hooks/README.md diff --git a/images/14.0/php7.3-fpm-alpine/hooks/build b/images/14.0/php7.3-fpm-alpine/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/14.0/php7.3-fpm-alpine/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/14.0/php7.3-fpm-alpine/hooks/post_push b/images/14.0/php7.3-fpm-alpine/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/14.0/php7.3-fpm-alpine/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/12.0/php7.3-apache-i386/hooks/post_test b/images/14.0/php7.3-fpm-alpine/hooks/post_test similarity index 100% rename from images/12.0/php7.3-apache-i386/hooks/post_test rename to images/14.0/php7.3-fpm-alpine/hooks/post_test diff --git a/images/14.0/php7.3-fpm-alpine/hooks/pre_push b/images/14.0/php7.3-fpm-alpine/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/14.0/php7.3-fpm-alpine/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/14.0/php7.3-fpm-alpine/hooks/pre_test b/images/14.0/php7.3-fpm-alpine/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/14.0/php7.3-fpm-alpine/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-apache-i386/hooks/run b/images/14.0/php7.3-fpm-alpine/hooks/run similarity index 100% rename from images/14.0/php7.3-apache-i386/hooks/run rename to images/14.0/php7.3-fpm-alpine/hooks/run diff --git a/images/14.0/php7.3-fpm-alpine/hooks/run_push b/images/14.0/php7.3-fpm-alpine/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/14.0/php7.3-fpm-alpine/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/12.0/php7.3-apache-i386/hooks/test b/images/14.0/php7.3-fpm-alpine/hooks/test similarity index 100% rename from images/12.0/php7.3-apache-i386/hooks/test rename to images/14.0/php7.3-fpm-alpine/hooks/test diff --git a/images/12.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template b/images/14.0/php7.3-fpm-alpine/nginx/templates/default.conf.template similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template rename to images/14.0/php7.3-fpm-alpine/nginx/templates/default.conf.template diff --git a/images/12.0/php7.3-apache-i386/test/Dockerfile b/images/14.0/php7.3-fpm-alpine/test/Dockerfile similarity index 100% rename from images/12.0/php7.3-apache-i386/test/Dockerfile rename to images/14.0/php7.3-fpm-alpine/test/Dockerfile diff --git a/images/12.0/php7.3-apache-i386/test/docker_test.sh b/images/14.0/php7.3-fpm-alpine/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-apache-i386/test/docker_test.sh rename to images/14.0/php7.3-fpm-alpine/test/docker_test.sh diff --git a/images/14.0/php7.3-fpm-amd64/.dockerignore b/images/14.0/php7.3-fpm-amd64/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/14.0/php7.3-fpm-amd64/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/14.0/php7.3-fpm-amd64/.dockertags b/images/14.0/php7.3-fpm-amd64/.dockertags deleted file mode 100644 index 99208ab6..00000000 --- a/images/14.0/php7.3-fpm-amd64/.dockertags +++ /dev/null @@ -1 +0,0 @@ -14.0.1-fpm 14.0-fpm diff --git a/images/14.0/php7.3-fpm-amd64/.env b/images/14.0/php7.3-fpm-amd64/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/14.0/php7.3-fpm-amd64/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/14.0/php7.3-fpm-amd64/Dockerfile b/images/14.0/php7.3-fpm-amd64/Dockerfile deleted file mode 100644 index 3d1b79a1..00000000 --- a/images/14.0/php7.3-fpm-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-fpm - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=14.0.1 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/14.0/php7.3-fpm-amd64/docker-compose.test.yml b/images/14.0/php7.3-fpm-amd64/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/14.0/php7.3-fpm-amd64/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/14.0/php7.3-fpm-amd64/entrypoint.sh b/images/14.0/php7.3-fpm-amd64/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/14.0/php7.3-fpm-amd64/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/14.0/php7.3-fpm-amd64/hooks/README.md b/images/14.0/php7.3-fpm-amd64/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/14.0/php7.3-fpm-amd64/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/14.0/php7.3-fpm-amd64/hooks/build b/images/14.0/php7.3-fpm-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/14.0/php7.3-fpm-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/14.0/php7.3-fpm-amd64/hooks/post_push b/images/14.0/php7.3-fpm-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/14.0/php7.3-fpm-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-fpm-amd64/hooks/post_test b/images/14.0/php7.3-fpm-amd64/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/14.0/php7.3-fpm-amd64/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-fpm-amd64/hooks/pre_push b/images/14.0/php7.3-fpm-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/14.0/php7.3-fpm-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-fpm-amd64/hooks/pre_test b/images/14.0/php7.3-fpm-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/14.0/php7.3-fpm-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-fpm-amd64/hooks/run b/images/14.0/php7.3-fpm-amd64/hooks/run deleted file mode 100755 index 6fdb47d9..00000000 --- a/images/14.0/php7.3-fpm-amd64/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=14.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/14.0/php7.3-fpm-amd64/hooks/test b/images/14.0/php7.3-fpm-amd64/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/14.0/php7.3-fpm-amd64/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/14.0/php7.3-fpm-amd64/nginx/templates/default.conf.template b/images/14.0/php7.3-fpm-amd64/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/14.0/php7.3-fpm-amd64/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/14.0/php7.3-fpm-amd64/test/Dockerfile b/images/14.0/php7.3-fpm-amd64/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/14.0/php7.3-fpm-amd64/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/14.0/php7.3-fpm-amd64/test/docker_test.sh b/images/14.0/php7.3-fpm-amd64/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/14.0/php7.3-fpm-amd64/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/14.0/php7.3-fpm-i386/.dockerignore b/images/14.0/php7.3-fpm-i386/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/14.0/php7.3-fpm-i386/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/14.0/php7.3-fpm-i386/.dockertags b/images/14.0/php7.3-fpm-i386/.dockertags deleted file mode 100644 index 99208ab6..00000000 --- a/images/14.0/php7.3-fpm-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -14.0.1-fpm 14.0-fpm diff --git a/images/14.0/php7.3-fpm-i386/.env b/images/14.0/php7.3-fpm-i386/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/14.0/php7.3-fpm-i386/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/14.0/php7.3-fpm-i386/Dockerfile b/images/14.0/php7.3-fpm-i386/Dockerfile deleted file mode 100644 index 9666cc11..00000000 --- a/images/14.0/php7.3-fpm-i386/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM i386/php:7.3-fpm - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=14.0.1 - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/14.0/php7.3-fpm-i386/docker-compose.test.yml b/images/14.0/php7.3-fpm-i386/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/14.0/php7.3-fpm-i386/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/14.0/php7.3-fpm-i386/entrypoint.sh b/images/14.0/php7.3-fpm-i386/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/14.0/php7.3-fpm-i386/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/14.0/php7.3-fpm-i386/hooks/README.md b/images/14.0/php7.3-fpm-i386/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/14.0/php7.3-fpm-i386/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/14.0/php7.3-fpm-i386/hooks/build b/images/14.0/php7.3-fpm-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/14.0/php7.3-fpm-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/14.0/php7.3-fpm-i386/hooks/post_push b/images/14.0/php7.3-fpm-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/14.0/php7.3-fpm-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-fpm-i386/hooks/post_test b/images/14.0/php7.3-fpm-i386/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/14.0/php7.3-fpm-i386/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-fpm-i386/hooks/pre_push b/images/14.0/php7.3-fpm-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/14.0/php7.3-fpm-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/14.0/php7.3-fpm-i386/hooks/pre_test b/images/14.0/php7.3-fpm-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/14.0/php7.3-fpm-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-fpm-i386/hooks/run b/images/14.0/php7.3-fpm-i386/hooks/run deleted file mode 100755 index 6fdb47d9..00000000 --- a/images/14.0/php7.3-fpm-i386/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=14.0 -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/14.0/php7.3-fpm-i386/hooks/test b/images/14.0/php7.3-fpm-i386/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/14.0/php7.3-fpm-i386/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/14.0/php7.3-fpm-i386/nginx/templates/default.conf.template b/images/14.0/php7.3-fpm-i386/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/14.0/php7.3-fpm-i386/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/14.0/php7.3-fpm-i386/test/Dockerfile b/images/14.0/php7.3-fpm-i386/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/14.0/php7.3-fpm-i386/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/14.0/php7.3-fpm-i386/test/docker_test.sh b/images/14.0/php7.3-fpm-i386/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/14.0/php7.3-fpm-i386/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/12.0/php7.3-fpm-alpine-amd64/.dockerignore b/images/14.0/php7.3-fpm/.dockerignore similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/.dockerignore rename to images/14.0/php7.3-fpm/.dockerignore diff --git a/images/14.0/php7.3-fpm/.dockertags b/images/14.0/php7.3-fpm/.dockertags new file mode 100644 index 00000000..01ee3559 --- /dev/null +++ b/images/14.0/php7.3-fpm/.dockertags @@ -0,0 +1 @@ +14.0.2-fpm 14.0-fpm diff --git a/images/12.0/php7.3-fpm-alpine-amd64/.env b/images/14.0/php7.3-fpm/.env similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/.env rename to images/14.0/php7.3-fpm/.env diff --git a/images/14.0/php7.3-fpm/Dockerfile b/images/14.0/php7.3-fpm/Dockerfile new file mode 100644 index 00000000..93e036f3 --- /dev/null +++ b/images/14.0/php7.3-fpm/Dockerfile @@ -0,0 +1,150 @@ +FROM php:7.3-fpm + +# Install the packages we need +# Install the PHP extensions we need +# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries +# Prepare folders +RUN set -ex; \ + apt-get update -q; \ + apt-get install -y --no-install-recommends \ + bzip2 \ + default-mysql-client \ + cron \ + rsync \ + sendmail \ + unzip \ + zip \ + ; \ + apt-get install -y --no-install-recommends \ + g++ \ + libcurl4-openssl-dev \ + libfreetype6-dev \ + libicu-dev \ + libjpeg-dev \ + libldap2-dev \ + libmagickcore-dev \ + libmagickwand-dev \ + libmcrypt-dev \ + libpng-dev \ + libpq-dev \ + libxml2-dev \ + libzip-dev \ + unzip \ + zlib1g-dev \ + ; \ + debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ + docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ + docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ + docker-php-ext-configure intl; \ + docker-php-ext-configure zip --with-libzip; \ + docker-php-ext-install -j "$(nproc)" \ + calendar \ + gd \ + intl \ + ldap \ + mbstring \ + mysqli \ + pdo \ + pdo_mysql \ + pdo_pgsql \ + pgsql \ + soap \ + zip \ + ; \ + pecl install imagick; \ + docker-php-ext-enable imagick; \ + rm -rf /var/lib/apt/lists/*; \ + mkdir -p /var/www/documents; \ + chown -R www-data:root /var/www; \ + chmod -R g=u /var/www + +VOLUME /var/www/html /var/www/documents /var/www/scripts + +# Runtime env var +ENV DOLI_AUTO_CONFIGURE=1 \ + DOLI_DB_TYPE=mysqli \ + DOLI_DB_HOST= \ + DOLI_DB_PORT=3306 \ + DOLI_DB_USER=dolibarr \ + DOLI_DB_PASSWORD='' \ + DOLI_DB_NAME=dolibarr \ + DOLI_DB_PREFIX=llx_ \ + DOLI_DB_CHARACTER_SET=utf8 \ + DOLI_DB_COLLATION=utf8_unicode_ci \ + DOLI_DB_ROOT_LOGIN='' \ + DOLI_DB_ROOT_PASSWORD='' \ + DOLI_ADMIN_LOGIN=admin \ + DOLI_MODULES='' \ + DOLI_URL_ROOT='http://localhost' \ + DOLI_AUTH=dolibarr \ + DOLI_LDAP_HOST= \ + DOLI_LDAP_PORT=389 \ + DOLI_LDAP_VERSION=3 \ + DOLI_LDAP_SERVERTYPE=openldap \ + DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ + DOLI_LDAP_DN='' \ + DOLI_LDAP_FILTER='' \ + DOLI_LDAP_ADMIN_LOGIN='' \ + DOLI_LDAP_ADMIN_PASS='' \ + DOLI_LDAP_DEBUG=false \ + DOLI_HTTPS=0 \ + DOLI_PROD=0 \ + DOLI_NO_CSRF_CHECK=0 \ + WWW_USER_ID=33 \ + WWW_GROUP_ID=33 \ + PHP_INI_DATE_TIMEZONE='UTC' \ + PHP_MEMORY_LIMIT=256M \ + PHP_MAX_UPLOAD=20M \ + PHP_MAX_EXECUTION_TIME=300 + +# Build time env var +ARG DOLI_VERSION=14.0.2 + +# Get Dolibarr +ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip + +# Install Dolibarr from tag archive +RUN set -ex; \ + mkdir -p /tmp/dolibarr; \ + unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ + rm /tmp/dolibarr.zip; \ + mkdir -p /usr/src/dolibarr; \ + cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ + rm -rf /tmp/dolibarr; \ + chmod +x /usr/src/dolibarr/scripts/*; \ + echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version + +COPY entrypoint.sh / +RUN set -ex; \ + chmod 755 /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["php-fpm"] + +# Arguments to label built container +ARG VCS_REF +ARG BUILD_DATE + +# Container labels (http://label-schema.org/) +# Container annotations (https://github.com/opencontainers/image-spec) +LABEL maintainer="Monogramm maintainers " \ + product="Dolibarr" \ + version=${DOLI_VERSION} \ + org.label-schema.vcs-ref=${VCS_REF} \ + org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ + org.label-schema.build-date=${BUILD_DATE} \ + org.label-schema.name="Dolibarr" \ + org.label-schema.description="Open Source ERP & CRM for Business" \ + org.label-schema.url="https://www.dolibarr.org/" \ + org.label-schema.vendor="Dolibarr" \ + org.label-schema.version=$DOLI_VERSION \ + org.label-schema.schema-version="1.0" \ + org.opencontainers.image.revision=${VCS_REF} \ + org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ + org.opencontainers.image.created=${BUILD_DATE} \ + org.opencontainers.image.title="Dolibarr" \ + org.opencontainers.image.description="Open Source ERP & CRM for Business" \ + org.opencontainers.image.url="https://www.dolibarr.org/" \ + org.opencontainers.image.vendor="Dolibarr" \ + org.opencontainers.image.version=${DOLI_VERSION} \ + org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/14.0/php7.3-fpm/docker-compose.test.yml b/images/14.0/php7.3-fpm/docker-compose.test.yml new file mode 100644 index 00000000..9e035418 --- /dev/null +++ b/images/14.0/php7.3-fpm/docker-compose.test.yml @@ -0,0 +1,130 @@ +version: "2.3" + +volumes: + db: + data: + documents: + scripts: + +services: + # https://docs.docker.com/docker-hub/builds/automated-testing/ + sut: + build: + context: ./test + dockerfile: Dockerfile + depends_on: + - dolibarr + - dolibarr_nginx + volumes_from: + - dolibarr + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + - DOCKER_TEST_CONTAINER=dolibarr + - DOCKER_WEB_CONTAINER=dolibarr_nginx + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr: + build: + context: ./ + dockerfile: Dockerfile + args: + - VCS_REF=${VCS_REF} + - BUILD_DATE=${BUILD_DATE} + image: ${IMAGE_NAME} + container_name: dolibarr + #restart: always + depends_on: + dolibarr_db: + condition: service_healthy + links: + - dolibarr_db + expose: + - "9000" + #ports: + # - "9090:9000" + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + #- /srv/dolibarr/html:/var/www/html + #- /srv/dolibarr/documents:/var/www/documents + #- /srv/dolibarr/scripts:/var/www/scripts + environment: + - DOLI_DB_TYPE=pgsql + - DOLI_DB_HOST=dolibarr_db # same as pgsql container name + - DOLI_DB_PORT=5432 + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_db: + image: postgres:latest + container_name: dolibarr_db + #restart: always + healthcheck: + test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] + interval: 60s + retries: 5 + #start-period: 10s + mem_limit: 256M + memswap_limit: 256M + expose: + - "5432" + #ports: + # - "55432:5432" + volumes: + - db:/var/lib/postgresql/data + #- /srv/dolibarr/db:/var/lib/postgresql/data + environment: + - POSTGRES_DB=${DOLIBARR_DB_NAME} + - POSTGRES_USER=${DOLIBARR_DB_USER} + - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_nginx: + image: nginx:latest + container_name: dolibarr_nginx + #restart: always + expose: + - "80" + #ports: + # - "8080:80" + # # If you need SSL connection + # - "8443:443" + depends_on: + - dolibarr + links: + - dolibarr + volumes: + - data:/var/www/html + #- /srv/dolibarr/html:/var/www/html + - ./nginx/templates:/etc/nginx/templates + # Provide a custom nginx conf + #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + # If you need SSL connection, you can provide your own certificates + # - ./certs:/etc/letsencrypt + # - ./certs-data:/data/letsencrypt + environment: + - NGINX_HOST=localhost # set your local domain or your live domain + - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name + + dolibarr_mailer: + image: sj26/mailcatcher:latest + hostname: dolibarr_mailer + container_name: dolibarr_mailer + restart: always + expose: + - 1025 + ports: + - "1025:1025" + - "1080:1080" + # If you want, you can sync time & timezone with host + #volumes: + # - /etc/localtime:/etc/localtime:ro + # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-fpm-alpine-amd64/entrypoint.sh b/images/14.0/php7.3-fpm/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/entrypoint.sh rename to images/14.0/php7.3-fpm/entrypoint.sh diff --git a/images/12.0/php7.3-fpm-alpine-amd64/hooks/README.md b/images/14.0/php7.3-fpm/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/hooks/README.md rename to images/14.0/php7.3-fpm/hooks/README.md diff --git a/images/14.0/php7.3-fpm/hooks/build b/images/14.0/php7.3-fpm/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/14.0/php7.3-fpm/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/14.0/php7.3-fpm/hooks/post_push b/images/14.0/php7.3-fpm/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/14.0/php7.3-fpm/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/12.0/php7.3-fpm-alpine-amd64/hooks/post_test b/images/14.0/php7.3-fpm/hooks/post_test similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/hooks/post_test rename to images/14.0/php7.3-fpm/hooks/post_test diff --git a/images/14.0/php7.3-fpm/hooks/pre_push b/images/14.0/php7.3-fpm/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/14.0/php7.3-fpm/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/14.0/php7.3-fpm/hooks/pre_test b/images/14.0/php7.3-fpm/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/14.0/php7.3-fpm/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/14.0/php7.3-fpm-alpine-amd64/hooks/run b/images/14.0/php7.3-fpm/hooks/run similarity index 100% rename from images/14.0/php7.3-fpm-alpine-amd64/hooks/run rename to images/14.0/php7.3-fpm/hooks/run diff --git a/images/14.0/php7.3-fpm/hooks/run_push b/images/14.0/php7.3-fpm/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/14.0/php7.3-fpm/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/12.0/php7.3-fpm-alpine-amd64/hooks/test b/images/14.0/php7.3-fpm/hooks/test similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/hooks/test rename to images/14.0/php7.3-fpm/hooks/test diff --git a/images/12.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template b/images/14.0/php7.3-fpm/nginx/templates/default.conf.template similarity index 100% rename from images/12.0/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template rename to images/14.0/php7.3-fpm/nginx/templates/default.conf.template diff --git a/images/12.0/php7.3-fpm-alpine-amd64/test/Dockerfile b/images/14.0/php7.3-fpm/test/Dockerfile similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/test/Dockerfile rename to images/14.0/php7.3-fpm/test/Dockerfile diff --git a/images/12.0/php7.3-fpm-alpine-amd64/test/docker_test.sh b/images/14.0/php7.3-fpm/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-fpm-alpine-amd64/test/docker_test.sh rename to images/14.0/php7.3-fpm/test/docker_test.sh diff --git a/images/develop/php7.3-apache-amd64/.dockerignore b/images/develop/php7.3-apache-amd64/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/develop/php7.3-apache-amd64/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/develop/php7.3-apache-amd64/.env b/images/develop/php7.3-apache-amd64/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/develop/php7.3-apache-amd64/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/develop/php7.3-apache-amd64/Dockerfile b/images/develop/php7.3-apache-amd64/Dockerfile deleted file mode 100644 index a10e1715..00000000 --- a/images/develop/php7.3-apache-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-apache - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=develop - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["apache2-foreground"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/develop/php7.3-apache-amd64/docker-compose.test.yml b/images/develop/php7.3-apache-amd64/docker-compose.test.yml deleted file mode 100644 index d4728e02..00000000 --- a/images/develop/php7.3-apache-amd64/docker-compose.test.yml +++ /dev/null @@ -1,109 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr_db - - dolibarr - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "80" - #ports: - # - "8080:80" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_HOST=dolibarr_db # same as mysql container name - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: mariadb:latest - container_name: dolibarr_db - #restart: always - command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE - healthcheck: - test: - [ - "CMD", - "mysqladmin", - "ping", - "-h", - "localhost", - "--password=${DOLIBARR_DB_ROOT_PWD}", - ] - timeout: 10s - retries: 5 - expose: - - "3306" - #ports: - # - "33306:3306" - volumes: - - db:/var/lib/mysql - #- /srv/dolibarr/db:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=${DOLIBARR_DB_ROOT_PWD} - - MYSQL_DATABASE=${DOLIBARR_DB_NAME} - - MYSQL_USER=${DOLIBARR_DB_USER} - - MYSQL_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/develop/php7.3-apache-amd64/entrypoint.sh b/images/develop/php7.3-apache-amd64/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/develop/php7.3-apache-amd64/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/develop/php7.3-apache-amd64/hooks/README.md b/images/develop/php7.3-apache-amd64/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/develop/php7.3-apache-amd64/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/develop/php7.3-apache-amd64/hooks/build b/images/develop/php7.3-apache-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/develop/php7.3-apache-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/develop/php7.3-apache-amd64/hooks/post_push b/images/develop/php7.3-apache-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/develop/php7.3-apache-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-apache-amd64/hooks/post_test b/images/develop/php7.3-apache-amd64/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/develop/php7.3-apache-amd64/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-apache-amd64/hooks/pre_push b/images/develop/php7.3-apache-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/develop/php7.3-apache-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-apache-amd64/hooks/pre_test b/images/develop/php7.3-apache-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/develop/php7.3-apache-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-apache-amd64/hooks/test b/images/develop/php7.3-apache-amd64/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/develop/php7.3-apache-amd64/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/develop/php7.3-apache-amd64/test/Dockerfile b/images/develop/php7.3-apache-amd64/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/develop/php7.3-apache-amd64/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/develop/php7.3-apache-amd64/test/docker_test.sh b/images/develop/php7.3-apache-amd64/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/develop/php7.3-apache-amd64/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/develop/php7.3-apache-i386/.dockerignore b/images/develop/php7.3-apache-i386/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/develop/php7.3-apache-i386/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/develop/php7.3-apache-i386/.dockertags b/images/develop/php7.3-apache-i386/.dockertags deleted file mode 100644 index d0bb2a8b..00000000 --- a/images/develop/php7.3-apache-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -develop-apache develop-apache develop develop diff --git a/images/develop/php7.3-apache-i386/.env b/images/develop/php7.3-apache-i386/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/develop/php7.3-apache-i386/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/develop/php7.3-apache-i386/docker-compose.test.yml b/images/develop/php7.3-apache-i386/docker-compose.test.yml deleted file mode 100644 index d4728e02..00000000 --- a/images/develop/php7.3-apache-i386/docker-compose.test.yml +++ /dev/null @@ -1,109 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr_db - - dolibarr - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "80" - #ports: - # - "8080:80" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_HOST=dolibarr_db # same as mysql container name - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: mariadb:latest - container_name: dolibarr_db - #restart: always - command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE - healthcheck: - test: - [ - "CMD", - "mysqladmin", - "ping", - "-h", - "localhost", - "--password=${DOLIBARR_DB_ROOT_PWD}", - ] - timeout: 10s - retries: 5 - expose: - - "3306" - #ports: - # - "33306:3306" - volumes: - - db:/var/lib/mysql - #- /srv/dolibarr/db:/var/lib/mysql - environment: - - MYSQL_ROOT_PASSWORD=${DOLIBARR_DB_ROOT_PWD} - - MYSQL_DATABASE=${DOLIBARR_DB_NAME} - - MYSQL_USER=${DOLIBARR_DB_USER} - - MYSQL_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/develop/php7.3-apache-i386/entrypoint.sh b/images/develop/php7.3-apache-i386/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/develop/php7.3-apache-i386/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/develop/php7.3-apache-i386/hooks/README.md b/images/develop/php7.3-apache-i386/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/develop/php7.3-apache-i386/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/develop/php7.3-apache-i386/hooks/build b/images/develop/php7.3-apache-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/develop/php7.3-apache-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/develop/php7.3-apache-i386/hooks/post_push b/images/develop/php7.3-apache-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/develop/php7.3-apache-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-apache-i386/hooks/post_test b/images/develop/php7.3-apache-i386/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/develop/php7.3-apache-i386/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-apache-i386/hooks/pre_push b/images/develop/php7.3-apache-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/develop/php7.3-apache-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-apache-i386/hooks/pre_test b/images/develop/php7.3-apache-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/develop/php7.3-apache-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-apache-i386/hooks/test b/images/develop/php7.3-apache-i386/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/develop/php7.3-apache-i386/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/develop/php7.3-apache-i386/test/Dockerfile b/images/develop/php7.3-apache-i386/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/develop/php7.3-apache-i386/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/develop/php7.3-apache-i386/test/docker_test.sh b/images/develop/php7.3-apache-i386/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/develop/php7.3-apache-i386/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/12.0/php7.3-fpm-alpine-i386/.dockerignore b/images/develop/php7.3-apache/.dockerignore similarity index 100% rename from images/12.0/php7.3-fpm-alpine-i386/.dockerignore rename to images/develop/php7.3-apache/.dockerignore diff --git a/images/develop/php7.3-apache-amd64/.dockertags b/images/develop/php7.3-apache/.dockertags similarity index 100% rename from images/develop/php7.3-apache-amd64/.dockertags rename to images/develop/php7.3-apache/.dockertags diff --git a/images/12.0/php7.3-fpm-alpine-i386/.env b/images/develop/php7.3-apache/.env similarity index 100% rename from images/12.0/php7.3-fpm-alpine-i386/.env rename to images/develop/php7.3-apache/.env diff --git a/images/develop/php7.3-apache-i386/Dockerfile b/images/develop/php7.3-apache/Dockerfile similarity index 99% rename from images/develop/php7.3-apache-i386/Dockerfile rename to images/develop/php7.3-apache/Dockerfile index 1de65951..c850072d 100644 --- a/images/develop/php7.3-apache-i386/Dockerfile +++ b/images/develop/php7.3-apache/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-apache +FROM php:7.3-apache # Install the packages we need # Install the PHP extensions we need diff --git a/images/develop/php7.3-apache/docker-compose.test.yml b/images/develop/php7.3-apache/docker-compose.test.yml new file mode 100644 index 00000000..ec96a5de --- /dev/null +++ b/images/develop/php7.3-apache/docker-compose.test.yml @@ -0,0 +1,108 @@ +version: "2.3" + +volumes: + db: + data: + documents: + scripts: + +services: + # https://docs.docker.com/docker-hub/builds/automated-testing/ + sut: + build: + context: ./test + dockerfile: Dockerfile + depends_on: + - dolibarr_db + - dolibarr + volumes_from: + - dolibarr + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + - DOCKER_TEST_CONTAINER=dolibarr + - DOCKER_WEB_CONTAINER=dolibarr + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr: + build: + context: ./ + dockerfile: Dockerfile + args: + - VCS_REF=${VCS_REF} + - BUILD_DATE=${BUILD_DATE} + image: ${IMAGE_NAME} + container_name: dolibarr + #restart: always + depends_on: + dolibarr_db: + condition: service_healthy + links: + - dolibarr_db + expose: + - "80" + #ports: + # - "8080:80" + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + #- /srv/dolibarr/html:/var/www/html + #- /srv/dolibarr/documents:/var/www/documents + #- /srv/dolibarr/scripts:/var/www/scripts + environment: + - DOLI_DB_HOST=dolibarr_db # same as mysql container name + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_db: + image: mariadb:latest + container_name: dolibarr_db + #restart: always + command: --character_set_client=utf8 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --character-set-client-handshake=FALSE + healthcheck: + test: + [ + "CMD", + "mysqladmin", + "ping", + "-h", + "localhost", + "--password=${DOLIBARR_DB_ROOT_PWD}", + ] + timeout: 10s + retries: 5 + expose: + - "3306" + #ports: + # - "33306:3306" + volumes: + - db:/var/lib/mysql + #- /srv/dolibarr/db:/var/lib/mysql + environment: + - MYSQL_ROOT_PASSWORD=${DOLIBARR_DB_ROOT_PWD} + - MYSQL_DATABASE=${DOLIBARR_DB_NAME} + - MYSQL_USER=${DOLIBARR_DB_USER} + - MYSQL_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_mailer: + image: sj26/mailcatcher:latest + hostname: dolibarr_mailer + container_name: dolibarr_mailer + restart: always + expose: + - 1025 + ports: + - "1025:1025" + - "1080:1080" + # If you want, you can sync time & timezone with host + #volumes: + # - /etc/localtime:/etc/localtime:ro + # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-fpm-alpine-i386/entrypoint.sh b/images/develop/php7.3-apache/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-fpm-alpine-i386/entrypoint.sh rename to images/develop/php7.3-apache/entrypoint.sh diff --git a/images/12.0/php7.3-fpm-alpine-i386/hooks/README.md b/images/develop/php7.3-apache/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/12.0/php7.3-fpm-alpine-i386/hooks/README.md rename to images/develop/php7.3-apache/hooks/README.md diff --git a/images/develop/php7.3-apache/hooks/build b/images/develop/php7.3-apache/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/develop/php7.3-apache/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/develop/php7.3-apache/hooks/post_push b/images/develop/php7.3-apache/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/develop/php7.3-apache/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/12.0/php7.3-fpm-alpine-i386/hooks/post_test b/images/develop/php7.3-apache/hooks/post_test similarity index 100% rename from images/12.0/php7.3-fpm-alpine-i386/hooks/post_test rename to images/develop/php7.3-apache/hooks/post_test diff --git a/images/develop/php7.3-apache/hooks/pre_push b/images/develop/php7.3-apache/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/develop/php7.3-apache/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/develop/php7.3-apache/hooks/pre_test b/images/develop/php7.3-apache/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/develop/php7.3-apache/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-apache-amd64/hooks/run b/images/develop/php7.3-apache/hooks/run similarity index 100% rename from images/develop/php7.3-apache-amd64/hooks/run rename to images/develop/php7.3-apache/hooks/run diff --git a/images/develop/php7.3-apache/hooks/run_push b/images/develop/php7.3-apache/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/develop/php7.3-apache/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/12.0/php7.3-fpm-alpine-i386/hooks/test b/images/develop/php7.3-apache/hooks/test similarity index 100% rename from images/12.0/php7.3-fpm-alpine-i386/hooks/test rename to images/develop/php7.3-apache/hooks/test diff --git a/images/12.0/php7.3-fpm-alpine-i386/test/Dockerfile b/images/develop/php7.3-apache/test/Dockerfile similarity index 100% rename from images/12.0/php7.3-fpm-alpine-i386/test/Dockerfile rename to images/develop/php7.3-apache/test/Dockerfile diff --git a/images/12.0/php7.3-fpm-alpine-i386/test/docker_test.sh b/images/develop/php7.3-apache/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-fpm-alpine-i386/test/docker_test.sh rename to images/develop/php7.3-apache/test/docker_test.sh diff --git a/images/develop/php7.3-fpm-alpine-amd64/.dockerignore b/images/develop/php7.3-fpm-alpine-amd64/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/develop/php7.3-fpm-alpine-amd64/.env b/images/develop/php7.3-fpm-alpine-amd64/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/develop/php7.3-fpm-alpine-amd64/Dockerfile b/images/develop/php7.3-fpm-alpine-amd64/Dockerfile deleted file mode 100644 index 334d4b9a..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/Dockerfile +++ /dev/null @@ -1,160 +0,0 @@ -FROM amd64/php:7.3-fpm-alpine - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apk add --no-cache \ - bzip2 \ - icu-libs \ - imagemagick \ - libldap \ - libpq \ - libpng \ - mysql-client \ - rsync \ - ssmtp \ - shadow \ - unzip \ - zip \ - ; \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - autoconf \ - curl-dev \ - freetype-dev \ - gcc \ - g++ \ - icu-dev \ - libjpeg-turbo-dev \ - imagemagick-dev \ - imagemagick-libs \ - libmcrypt-dev \ - libpng-dev \ - libtool \ - libxml2-dev \ - libzip-dev \ - make \ - openldap-dev \ - postgresql-dev \ - postgresql-libs \ - unzip \ - zlib-dev \ - ; \ - docker-php-ext-configure ldap; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - apk --purge del .build-deps; \ - rm -rf /var/cache/apk/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=82 \ - WWW_GROUP_ID=82 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=develop - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=$BUILD_DATE \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=${DOLI_VERSION} \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/develop/php7.3-fpm-alpine-amd64/docker-compose.test.yml b/images/develop/php7.3-fpm-alpine-amd64/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/develop/php7.3-fpm-alpine-amd64/entrypoint.sh b/images/develop/php7.3-fpm-alpine-amd64/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/develop/php7.3-fpm-alpine-amd64/hooks/README.md b/images/develop/php7.3-fpm-alpine-amd64/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/develop/php7.3-fpm-alpine-amd64/hooks/build b/images/develop/php7.3-fpm-alpine-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/develop/php7.3-fpm-alpine-amd64/hooks/post_push b/images/develop/php7.3-fpm-alpine-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-fpm-alpine-amd64/hooks/post_test b/images/develop/php7.3-fpm-alpine-amd64/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-fpm-alpine-amd64/hooks/pre_push b/images/develop/php7.3-fpm-alpine-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-fpm-alpine-amd64/hooks/pre_test b/images/develop/php7.3-fpm-alpine-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-fpm-alpine-amd64/hooks/test b/images/develop/php7.3-fpm-alpine-amd64/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/develop/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template b/images/develop/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/develop/php7.3-fpm-alpine-amd64/test/Dockerfile b/images/develop/php7.3-fpm-alpine-amd64/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/develop/php7.3-fpm-alpine-amd64/test/docker_test.sh b/images/develop/php7.3-fpm-alpine-amd64/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/develop/php7.3-fpm-alpine-amd64/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/develop/php7.3-fpm-alpine-i386/.dockerignore b/images/develop/php7.3-fpm-alpine-i386/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/develop/php7.3-fpm-alpine-i386/.dockertags b/images/develop/php7.3-fpm-alpine-i386/.dockertags deleted file mode 100644 index 023adab6..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -develop-fpm-alpine develop-fpm-alpine diff --git a/images/develop/php7.3-fpm-alpine-i386/.env b/images/develop/php7.3-fpm-alpine-i386/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/develop/php7.3-fpm-alpine-i386/docker-compose.test.yml b/images/develop/php7.3-fpm-alpine-i386/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/develop/php7.3-fpm-alpine-i386/entrypoint.sh b/images/develop/php7.3-fpm-alpine-i386/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/develop/php7.3-fpm-alpine-i386/hooks/README.md b/images/develop/php7.3-fpm-alpine-i386/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/develop/php7.3-fpm-alpine-i386/hooks/build b/images/develop/php7.3-fpm-alpine-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/develop/php7.3-fpm-alpine-i386/hooks/post_push b/images/develop/php7.3-fpm-alpine-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-fpm-alpine-i386/hooks/post_test b/images/develop/php7.3-fpm-alpine-i386/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-fpm-alpine-i386/hooks/pre_push b/images/develop/php7.3-fpm-alpine-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-fpm-alpine-i386/hooks/pre_test b/images/develop/php7.3-fpm-alpine-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-fpm-alpine-i386/hooks/run b/images/develop/php7.3-fpm-alpine-i386/hooks/run deleted file mode 100755 index d8c6eb8f..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=develop -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/develop/php7.3-fpm-alpine-i386/hooks/test b/images/develop/php7.3-fpm-alpine-i386/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/develop/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template b/images/develop/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/develop/php7.3-fpm-alpine-i386/test/Dockerfile b/images/develop/php7.3-fpm-alpine-i386/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/develop/php7.3-fpm-alpine-i386/test/docker_test.sh b/images/develop/php7.3-fpm-alpine-i386/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/develop/php7.3-fpm-alpine-i386/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/12.0/php7.3-fpm-amd64/.dockerignore b/images/develop/php7.3-fpm-alpine/.dockerignore similarity index 100% rename from images/12.0/php7.3-fpm-amd64/.dockerignore rename to images/develop/php7.3-fpm-alpine/.dockerignore diff --git a/images/develop/php7.3-fpm-alpine-amd64/.dockertags b/images/develop/php7.3-fpm-alpine/.dockertags similarity index 100% rename from images/develop/php7.3-fpm-alpine-amd64/.dockertags rename to images/develop/php7.3-fpm-alpine/.dockertags diff --git a/images/12.0/php7.3-fpm-amd64/.env b/images/develop/php7.3-fpm-alpine/.env similarity index 100% rename from images/12.0/php7.3-fpm-amd64/.env rename to images/develop/php7.3-fpm-alpine/.env diff --git a/images/develop/php7.3-fpm-alpine-i386/Dockerfile b/images/develop/php7.3-fpm-alpine/Dockerfile similarity index 99% rename from images/develop/php7.3-fpm-alpine-i386/Dockerfile rename to images/develop/php7.3-fpm-alpine/Dockerfile index 14a980be..0fb8a2ce 100644 --- a/images/develop/php7.3-fpm-alpine-i386/Dockerfile +++ b/images/develop/php7.3-fpm-alpine/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-fpm-alpine +FROM php:7.3-fpm-alpine # Install the packages we need # Install the PHP extensions we need diff --git a/images/develop/php7.3-fpm-alpine/docker-compose.test.yml b/images/develop/php7.3-fpm-alpine/docker-compose.test.yml new file mode 100644 index 00000000..9e035418 --- /dev/null +++ b/images/develop/php7.3-fpm-alpine/docker-compose.test.yml @@ -0,0 +1,130 @@ +version: "2.3" + +volumes: + db: + data: + documents: + scripts: + +services: + # https://docs.docker.com/docker-hub/builds/automated-testing/ + sut: + build: + context: ./test + dockerfile: Dockerfile + depends_on: + - dolibarr + - dolibarr_nginx + volumes_from: + - dolibarr + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + - DOCKER_TEST_CONTAINER=dolibarr + - DOCKER_WEB_CONTAINER=dolibarr_nginx + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr: + build: + context: ./ + dockerfile: Dockerfile + args: + - VCS_REF=${VCS_REF} + - BUILD_DATE=${BUILD_DATE} + image: ${IMAGE_NAME} + container_name: dolibarr + #restart: always + depends_on: + dolibarr_db: + condition: service_healthy + links: + - dolibarr_db + expose: + - "9000" + #ports: + # - "9090:9000" + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + #- /srv/dolibarr/html:/var/www/html + #- /srv/dolibarr/documents:/var/www/documents + #- /srv/dolibarr/scripts:/var/www/scripts + environment: + - DOLI_DB_TYPE=pgsql + - DOLI_DB_HOST=dolibarr_db # same as pgsql container name + - DOLI_DB_PORT=5432 + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_db: + image: postgres:latest + container_name: dolibarr_db + #restart: always + healthcheck: + test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] + interval: 60s + retries: 5 + #start-period: 10s + mem_limit: 256M + memswap_limit: 256M + expose: + - "5432" + #ports: + # - "55432:5432" + volumes: + - db:/var/lib/postgresql/data + #- /srv/dolibarr/db:/var/lib/postgresql/data + environment: + - POSTGRES_DB=${DOLIBARR_DB_NAME} + - POSTGRES_USER=${DOLIBARR_DB_USER} + - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_nginx: + image: nginx:latest + container_name: dolibarr_nginx + #restart: always + expose: + - "80" + #ports: + # - "8080:80" + # # If you need SSL connection + # - "8443:443" + depends_on: + - dolibarr + links: + - dolibarr + volumes: + - data:/var/www/html + #- /srv/dolibarr/html:/var/www/html + - ./nginx/templates:/etc/nginx/templates + # Provide a custom nginx conf + #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + # If you need SSL connection, you can provide your own certificates + # - ./certs:/etc/letsencrypt + # - ./certs-data:/data/letsencrypt + environment: + - NGINX_HOST=localhost # set your local domain or your live domain + - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name + + dolibarr_mailer: + image: sj26/mailcatcher:latest + hostname: dolibarr_mailer + container_name: dolibarr_mailer + restart: always + expose: + - 1025 + ports: + - "1025:1025" + - "1080:1080" + # If you want, you can sync time & timezone with host + #volumes: + # - /etc/localtime:/etc/localtime:ro + # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-fpm-amd64/entrypoint.sh b/images/develop/php7.3-fpm-alpine/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-fpm-amd64/entrypoint.sh rename to images/develop/php7.3-fpm-alpine/entrypoint.sh diff --git a/images/12.0/php7.3-fpm-amd64/hooks/README.md b/images/develop/php7.3-fpm-alpine/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/12.0/php7.3-fpm-amd64/hooks/README.md rename to images/develop/php7.3-fpm-alpine/hooks/README.md diff --git a/images/develop/php7.3-fpm-alpine/hooks/build b/images/develop/php7.3-fpm-alpine/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/develop/php7.3-fpm-alpine/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/develop/php7.3-fpm-alpine/hooks/post_push b/images/develop/php7.3-fpm-alpine/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/develop/php7.3-fpm-alpine/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/12.0/php7.3-fpm-amd64/hooks/post_test b/images/develop/php7.3-fpm-alpine/hooks/post_test similarity index 100% rename from images/12.0/php7.3-fpm-amd64/hooks/post_test rename to images/develop/php7.3-fpm-alpine/hooks/post_test diff --git a/images/develop/php7.3-fpm-alpine/hooks/pre_push b/images/develop/php7.3-fpm-alpine/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/develop/php7.3-fpm-alpine/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/develop/php7.3-fpm-alpine/hooks/pre_test b/images/develop/php7.3-fpm-alpine/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/develop/php7.3-fpm-alpine/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-apache-i386/hooks/run b/images/develop/php7.3-fpm-alpine/hooks/run similarity index 100% rename from images/develop/php7.3-apache-i386/hooks/run rename to images/develop/php7.3-fpm-alpine/hooks/run diff --git a/images/develop/php7.3-fpm-alpine/hooks/run_push b/images/develop/php7.3-fpm-alpine/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/develop/php7.3-fpm-alpine/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/12.0/php7.3-fpm-amd64/hooks/test b/images/develop/php7.3-fpm-alpine/hooks/test similarity index 100% rename from images/12.0/php7.3-fpm-amd64/hooks/test rename to images/develop/php7.3-fpm-alpine/hooks/test diff --git a/images/12.0/php7.3-fpm-amd64/nginx/templates/default.conf.template b/images/develop/php7.3-fpm-alpine/nginx/templates/default.conf.template similarity index 100% rename from images/12.0/php7.3-fpm-amd64/nginx/templates/default.conf.template rename to images/develop/php7.3-fpm-alpine/nginx/templates/default.conf.template diff --git a/images/12.0/php7.3-fpm-amd64/test/Dockerfile b/images/develop/php7.3-fpm-alpine/test/Dockerfile similarity index 100% rename from images/12.0/php7.3-fpm-amd64/test/Dockerfile rename to images/develop/php7.3-fpm-alpine/test/Dockerfile diff --git a/images/12.0/php7.3-fpm-amd64/test/docker_test.sh b/images/develop/php7.3-fpm-alpine/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-fpm-amd64/test/docker_test.sh rename to images/develop/php7.3-fpm-alpine/test/docker_test.sh diff --git a/images/develop/php7.3-fpm-amd64/.dockerignore b/images/develop/php7.3-fpm-amd64/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/develop/php7.3-fpm-amd64/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/develop/php7.3-fpm-amd64/.env b/images/develop/php7.3-fpm-amd64/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/develop/php7.3-fpm-amd64/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/develop/php7.3-fpm-amd64/Dockerfile b/images/develop/php7.3-fpm-amd64/Dockerfile deleted file mode 100644 index e517e28c..00000000 --- a/images/develop/php7.3-fpm-amd64/Dockerfile +++ /dev/null @@ -1,150 +0,0 @@ -FROM amd64/php:7.3-fpm - -# Install the packages we need -# Install the PHP extensions we need -# see https://wiki.dolibarr.org/index.php/Dependencies_and_external_libraries -# Prepare folders -RUN set -ex; \ - apt-get update -q; \ - apt-get install -y --no-install-recommends \ - bzip2 \ - default-mysql-client \ - cron \ - rsync \ - sendmail \ - unzip \ - zip \ - ; \ - apt-get install -y --no-install-recommends \ - g++ \ - libcurl4-openssl-dev \ - libfreetype6-dev \ - libicu-dev \ - libjpeg-dev \ - libldap2-dev \ - libmagickcore-dev \ - libmagickwand-dev \ - libmcrypt-dev \ - libpng-dev \ - libpq-dev \ - libxml2-dev \ - libzip-dev \ - unzip \ - zlib1g-dev \ - ; \ - debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \ - docker-php-ext-configure ldap --with-libdir="lib/$debMultiarch"; \ - docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr; \ - docker-php-ext-configure intl; \ - docker-php-ext-configure zip --with-libzip; \ - docker-php-ext-install -j "$(nproc)" \ - calendar \ - gd \ - intl \ - ldap \ - mbstring \ - mysqli \ - pdo \ - pdo_mysql \ - pdo_pgsql \ - pgsql \ - soap \ - zip \ - ; \ - pecl install imagick; \ - docker-php-ext-enable imagick; \ - rm -rf /var/lib/apt/lists/*; \ - mkdir -p /var/www/documents; \ - chown -R www-data:root /var/www; \ - chmod -R g=u /var/www - -VOLUME /var/www/html /var/www/documents /var/www/scripts - -# Runtime env var -ENV DOLI_AUTO_CONFIGURE=1 \ - DOLI_DB_TYPE=mysqli \ - DOLI_DB_HOST= \ - DOLI_DB_PORT=3306 \ - DOLI_DB_USER=dolibarr \ - DOLI_DB_PASSWORD='' \ - DOLI_DB_NAME=dolibarr \ - DOLI_DB_PREFIX=llx_ \ - DOLI_DB_CHARACTER_SET=utf8 \ - DOLI_DB_COLLATION=utf8_unicode_ci \ - DOLI_DB_ROOT_LOGIN='' \ - DOLI_DB_ROOT_PASSWORD='' \ - DOLI_ADMIN_LOGIN=admin \ - DOLI_MODULES='' \ - DOLI_URL_ROOT='http://localhost' \ - DOLI_AUTH=dolibarr \ - DOLI_LDAP_HOST= \ - DOLI_LDAP_PORT=389 \ - DOLI_LDAP_VERSION=3 \ - DOLI_LDAP_SERVERTYPE=openldap \ - DOLI_LDAP_LOGIN_ATTRIBUTE=uid \ - DOLI_LDAP_DN='' \ - DOLI_LDAP_FILTER='' \ - DOLI_LDAP_ADMIN_LOGIN='' \ - DOLI_LDAP_ADMIN_PASS='' \ - DOLI_LDAP_DEBUG=false \ - DOLI_HTTPS=0 \ - DOLI_PROD=0 \ - DOLI_NO_CSRF_CHECK=0 \ - WWW_USER_ID=33 \ - WWW_GROUP_ID=33 \ - PHP_INI_DATE_TIMEZONE='UTC' \ - PHP_MEMORY_LIMIT=256M \ - PHP_MAX_UPLOAD=20M \ - PHP_MAX_EXECUTION_TIME=300 - -# Build time env var -ARG DOLI_VERSION=develop - -# Get Dolibarr -ADD https://github.com/Dolibarr/dolibarr/archive/${DOLI_VERSION}.zip /tmp/dolibarr.zip - -# Install Dolibarr from tag archive -RUN set -ex; \ - mkdir -p /tmp/dolibarr; \ - unzip -q /tmp/dolibarr.zip -d /tmp/dolibarr; \ - rm /tmp/dolibarr.zip; \ - mkdir -p /usr/src/dolibarr; \ - cp -r "/tmp/dolibarr/dolibarr-${DOLI_VERSION}"/* /usr/src/dolibarr; \ - rm -rf /tmp/dolibarr; \ - chmod +x /usr/src/dolibarr/scripts/*; \ - echo "${DOLI_VERSION}" > /usr/src/dolibarr/.docker-image-version - -COPY entrypoint.sh / -RUN set -ex; \ - chmod 755 /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["php-fpm"] - -# Arguments to label built container -ARG VCS_REF -ARG BUILD_DATE - -# Container labels (http://label-schema.org/) -# Container annotations (https://github.com/opencontainers/image-spec) -LABEL maintainer="Monogramm maintainers " \ - product="Dolibarr" \ - version=${DOLI_VERSION} \ - org.label-schema.vcs-ref=${VCS_REF} \ - org.label-schema.vcs-url="https://github.com/Monogramm/docker-dolibarr" \ - org.label-schema.build-date=${BUILD_DATE} \ - org.label-schema.name="Dolibarr" \ - org.label-schema.description="Open Source ERP & CRM for Business" \ - org.label-schema.url="https://www.dolibarr.org/" \ - org.label-schema.vendor="Dolibarr" \ - org.label-schema.version=$DOLI_VERSION \ - org.label-schema.schema-version="1.0" \ - org.opencontainers.image.revision=${VCS_REF} \ - org.opencontainers.image.source="https://github.com/Monogramm/docker-dolibarr" \ - org.opencontainers.image.created=${BUILD_DATE} \ - org.opencontainers.image.title="Dolibarr" \ - org.opencontainers.image.description="Open Source ERP & CRM for Business" \ - org.opencontainers.image.url="https://www.dolibarr.org/" \ - org.opencontainers.image.vendor="Dolibarr" \ - org.opencontainers.image.version=${DOLI_VERSION} \ - org.opencontainers.image.authors="Monogramm maintainers " diff --git a/images/develop/php7.3-fpm-amd64/docker-compose.test.yml b/images/develop/php7.3-fpm-amd64/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/develop/php7.3-fpm-amd64/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/develop/php7.3-fpm-amd64/entrypoint.sh b/images/develop/php7.3-fpm-amd64/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/develop/php7.3-fpm-amd64/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/develop/php7.3-fpm-amd64/hooks/README.md b/images/develop/php7.3-fpm-amd64/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/develop/php7.3-fpm-amd64/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/develop/php7.3-fpm-amd64/hooks/build b/images/develop/php7.3-fpm-amd64/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/develop/php7.3-fpm-amd64/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/develop/php7.3-fpm-amd64/hooks/post_push b/images/develop/php7.3-fpm-amd64/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/develop/php7.3-fpm-amd64/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-fpm-amd64/hooks/post_test b/images/develop/php7.3-fpm-amd64/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/develop/php7.3-fpm-amd64/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-fpm-amd64/hooks/pre_push b/images/develop/php7.3-fpm-amd64/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/develop/php7.3-fpm-amd64/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-fpm-amd64/hooks/pre_test b/images/develop/php7.3-fpm-amd64/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/develop/php7.3-fpm-amd64/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-fpm-amd64/hooks/run b/images/develop/php7.3-fpm-amd64/hooks/run deleted file mode 100755 index d8c6eb8f..00000000 --- a/images/develop/php7.3-fpm-amd64/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=develop -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/develop/php7.3-fpm-amd64/hooks/test b/images/develop/php7.3-fpm-amd64/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/develop/php7.3-fpm-amd64/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/develop/php7.3-fpm-amd64/nginx/templates/default.conf.template b/images/develop/php7.3-fpm-amd64/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/develop/php7.3-fpm-amd64/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/develop/php7.3-fpm-amd64/test/Dockerfile b/images/develop/php7.3-fpm-amd64/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/develop/php7.3-fpm-amd64/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/develop/php7.3-fpm-amd64/test/docker_test.sh b/images/develop/php7.3-fpm-amd64/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/develop/php7.3-fpm-amd64/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/develop/php7.3-fpm-i386/.dockerignore b/images/develop/php7.3-fpm-i386/.dockerignore deleted file mode 100644 index ac1cdc09..00000000 --- a/images/develop/php7.3-fpm-i386/.dockerignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore CI docker-compose -docker-compose.yml -nginx.conf diff --git a/images/develop/php7.3-fpm-i386/.dockertags b/images/develop/php7.3-fpm-i386/.dockertags deleted file mode 100644 index 92ced134..00000000 --- a/images/develop/php7.3-fpm-i386/.dockertags +++ /dev/null @@ -1 +0,0 @@ -develop-fpm develop-fpm diff --git a/images/develop/php7.3-fpm-i386/.env b/images/develop/php7.3-fpm-i386/.env deleted file mode 100644 index 9f66636e..00000000 --- a/images/develop/php7.3-fpm-i386/.env +++ /dev/null @@ -1,10 +0,0 @@ - -######################################## -# Dolibarr configuration -######################################## - -DOLIBARR_DB_ROOT_PWD=mysqlrootdolibarr - -DOLIBARR_DB_NAME=dolibarr -DOLIBARR_DB_USER=dolibarr -DOLIBARR_DB_PASSWORD=dolibarr_password diff --git a/images/develop/php7.3-fpm-i386/docker-compose.test.yml b/images/develop/php7.3-fpm-i386/docker-compose.test.yml deleted file mode 100644 index 428bbae2..00000000 --- a/images/develop/php7.3-fpm-i386/docker-compose.test.yml +++ /dev/null @@ -1,131 +0,0 @@ -version: "2.3" - -volumes: - db: - data: - documents: - scripts: - -services: - # https://docs.docker.com/docker-hub/builds/automated-testing/ - sut: - build: - context: ./test - dockerfile: Dockerfile - depends_on: - - dolibarr - - dolibarr_nginx - volumes_from: - - dolibarr - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - - /etc/localtime:/etc/localtime:ro - - /etc/timezone:/etc/timezone:ro - environment: - - DOCKER_TEST_CONTAINER=dolibarr - - DOCKER_WEB_CONTAINER=dolibarr_nginx - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr: - build: - context: ./ - dockerfile: Dockerfile - args: - - TAG=${TAG} - - VCS_REF=${VCS_REF} - - BUILD_DATE=${BUILD_DATE} - image: ${IMAGE_NAME} - container_name: dolibarr - #restart: always - depends_on: - dolibarr_db: - condition: service_healthy - links: - - dolibarr_db - expose: - - "9000" - #ports: - # - "9090:9000" - volumes: - - data:/var/www/html - - documents:/var/www/documents - - scripts:/var/www/scripts - #- /srv/dolibarr/html:/var/www/html - #- /srv/dolibarr/documents:/var/www/documents - #- /srv/dolibarr/scripts:/var/www/scripts - environment: - - DOLI_DB_TYPE=pgsql - - DOLI_DB_HOST=dolibarr_db # same as pgsql container name - - DOLI_DB_PORT=5432 - - DOLI_DB_NAME=${DOLIBARR_DB_NAME} - - DOLI_DB_USER=${DOLIBARR_DB_USER} - - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_db: - image: postgres:latest - container_name: dolibarr_db - #restart: always - healthcheck: - test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] - interval: 60s - retries: 5 - #start-period: 10s - mem_limit: 256M - memswap_limit: 256M - expose: - - "5432" - #ports: - # - "55432:5432" - volumes: - - db:/var/lib/postgresql/data - #- /srv/dolibarr/db:/var/lib/postgresql/data - environment: - - POSTGRES_DB=${DOLIBARR_DB_NAME} - - POSTGRES_USER=${DOLIBARR_DB_USER} - - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} - - dolibarr_nginx: - image: nginx:latest - container_name: dolibarr_nginx - #restart: always - expose: - - "80" - #ports: - # - "8080:80" - # # If you need SSL connection - # - "8443:443" - depends_on: - - dolibarr - links: - - dolibarr - volumes: - - data:/var/www/html - #- /srv/dolibarr/html:/var/www/html - - ./nginx/templates:/etc/nginx/templates - # Provide a custom nginx conf - #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - # If you need SSL connection, you can provide your own certificates - # - ./certs:/etc/letsencrypt - # - ./certs-data:/data/letsencrypt - environment: - - NGINX_HOST=localhost # set your local domain or your live domain - - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name - - dolibarr_mailer: - image: sj26/mailcatcher:latest - hostname: dolibarr_mailer - container_name: dolibarr_mailer - restart: always - expose: - - 1025 - ports: - - "1025:1025" - - "1080:1080" - # If you want, you can sync time & timezone with host - #volumes: - # - /etc/localtime:/etc/localtime:ro - # - /etc/timezone:/etc/timezone:ro diff --git a/images/develop/php7.3-fpm-i386/entrypoint.sh b/images/develop/php7.3-fpm-i386/entrypoint.sh deleted file mode 100755 index ddeba201..00000000 --- a/images/develop/php7.3-fpm-i386/entrypoint.sh +++ /dev/null @@ -1,271 +0,0 @@ -#!/bin/sh -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -# version_greater A B returns whether A > B -version_greater() { - [ "$(printf '%s\n' "$@" | sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 | head -n 1)" != "$1" ] -} - -# return true if specified directory is empty -directory_empty() { - [ -z "$(ls -A "$1/")" ] -} - -run_as() { - if [ "$(id -u)" = 0 ]; then - su - www-data -s /bin/sh -c "$1" - else - sh -c "$1" - fi -} - - -if [ ! -f /usr/local/etc/php/php.ini ]; then - log "Initializing PHP configuration..." - cat < /usr/local/etc/php/php.ini -date.timezone = "${PHP_INI_DATE_TIMEZONE}" -memory_limit = ${PHP_MEMORY_LIMIT} -file_uploads = On -upload_max_filesize = ${PHP_MAX_UPLOAD} -post_max_size = ${PHP_MAX_UPLOAD} -max_execution_time = ${PHP_MAX_EXECUTION_TIME} -sendmail_path = /usr/sbin/sendmail -t -i -extension = calendar.so -EOF -fi - - -if [ ! -d /var/www/documents ]; then - log "Initializing Dolibarr documents directory..." - mkdir -p /var/www/documents -fi - -log "Updating Dolibarr users and group..." -usermod -u "$WWW_USER_ID" www-data -groupmod -g "$WWW_GROUP_ID" www-data - -log "Updating Dolibarr folder ownership..." -chown -R www-data:www-data /var/www - - -if [ ! -d /var/www/html/conf/ ]; then - log "Initializing Dolibarr HTML configuration directory..." - mkdir -p /var/www/html/conf/ -fi - -# Create a default config if autoconfig enabled -if [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/html/conf/conf.php ]; then - log "Initializing Dolibarr HTML configuration..." - cat < /var/www/html/conf/conf.php - /var/www/documents/install.lock - chown www-data:www-data /var/www/documents/install.lock - chmod 400 /var/www/documents/install.lock - elif [ -n "$DOLI_AUTO_CONFIGURE" ] && [ ! -f /var/www/documents/install.lock ]; then - log "Create forced values for first Dolibarr install..." - cat < /var/www/html/install/install.forced.php - /var/www/documents/.docker-container-version -fi - -log "Serving Dolibarr..." -exec "$@" diff --git a/images/develop/php7.3-fpm-i386/hooks/README.md b/images/develop/php7.3-fpm-i386/hooks/README.md deleted file mode 100644 index 7cf561f1..00000000 --- a/images/develop/php7.3-fpm-i386/hooks/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# DockerHub automated tests hooks - -See documentation for details: diff --git a/images/develop/php7.3-fpm-i386/hooks/build b/images/develop/php7.3-fpm-i386/hooks/build deleted file mode 100755 index d2369475..00000000 --- a/images/develop/php7.3-fpm-i386/hooks/build +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ -# https://microbadger.com/labels - -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ - --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ - --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ - -f "$DOCKERFILE_PATH" \ - -t "$IMAGE_NAME" . diff --git a/images/develop/php7.3-fpm-i386/hooks/post_push b/images/develop/php7.3-fpm-i386/hooks/post_push deleted file mode 100755 index b0aa55b0..00000000 --- a/images/develop/php7.3-fpm-i386/hooks/post_push +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -f ./.dockertags ]; then - for tag in $(cat ./.dockertags); do - if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" - fi - done -fi - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker logout "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-fpm-i386/hooks/post_test b/images/develop/php7.3-fpm-i386/hooks/post_test deleted file mode 100755 index 007963de..00000000 --- a/images/develop/php7.3-fpm-i386/hooks/post_test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -#echo 'Removing persisted data...' -#rm -rf "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-fpm-i386/hooks/pre_push b/images/develop/php7.3-fpm-i386/hooks/pre_push deleted file mode 100755 index 33d1f879..00000000 --- a/images/develop/php7.3-fpm-i386/hooks/pre_push +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" -fi diff --git a/images/develop/php7.3-fpm-i386/hooks/pre_test b/images/develop/php7.3-fpm-i386/hooks/pre_test deleted file mode 100755 index a7936aa9..00000000 --- a/images/develop/php7.3-fpm-i386/hooks/pre_test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ ! -f '.env' ]; then - echo 'Init docker compose environment variables...' - cp .env_template .env.tmp - - mv .env.tmp .env -fi - -#echo 'Preparing persisted data...' -#mkdir -p "${APP_HOME:-/srv/dolibarr}" -#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-fpm-i386/hooks/run b/images/develop/php7.3-fpm-i386/hooks/run deleted file mode 100755 index d8c6eb8f..00000000 --- a/images/develop/php7.3-fpm-i386/hooks/run +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -# Custom script to run locally DockerHub hooks -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -echo "Custom script to run locally DockerHub hooks..." -set -e - -export SOURCE_BRANCH -SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) -export SOURCE_COMMIT -SOURCE_COMMIT=$(git rev-parse --short HEAD) -export COMMIT_MSG -COMMIT_MSG=$(git log -1 --format=%s) - -export DOCKER_REPO=monogramm/docker-dolibarr -export DOCKERFILE_PATH=Dockerfile -export DOCKER_TAG=develop -export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} - -# Execute hooks in given order -IFS=',' read -ra STEPS <<< "${1:-build,test}" -for step in "${STEPS[@]}" -do - for hook in "pre_${step}" "${step}" "post_${step}"; do - if [ -f "./hooks/${hook}" ]; then - echo "Executing ${hook} hook..." - "./hooks/${hook}" - fi - done -done - -echo "DockerHub hooks finished" diff --git a/images/develop/php7.3-fpm-i386/hooks/test b/images/develop/php7.3-fpm-i386/hooks/test deleted file mode 100755 index 57fa821f..00000000 --- a/images/develop/php7.3-fpm-i386/hooks/test +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash - -# See documentation for details: -# https://docs.docker.com/docker-hub/builds/advanced/ - -if [ "${DOCKERFILE_PATH}" = "Dockerfile.develop" ] || [ "${DOCKERFILE_PATH}" = "Dockerfile.gitpod" ]; then - echo "No tests (yet) for ${DOCKERFILE_PATH} images." - exit 0 -fi - -for file in docker-compose*.test.yml; do - - echo "Starting Test in ${file}..." - - # Build test container - docker-compose --no-ansi -f "${file}" build sut - # Test container run - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down - - # Test container restart - docker-compose --no-ansi -f "${file}" up -d && sleep 60 - docker-compose --no-ansi -f "${file}" logs -f "sut" - docker-compose --no-ansi -f "${file}" ps - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr_db" - docker-compose --no-ansi -f "${file}" logs --no-color "dolibarr" - docker-compose --no-ansi -f "${file}" ps "sut" | grep "Exit 0" || exit 1 - docker-compose --no-ansi -f "${file}" down -v - -done diff --git a/images/develop/php7.3-fpm-i386/nginx/templates/default.conf.template b/images/develop/php7.3-fpm-i386/nginx/templates/default.conf.template deleted file mode 100644 index c1f67482..00000000 --- a/images/develop/php7.3-fpm-i386/nginx/templates/default.conf.template +++ /dev/null @@ -1,60 +0,0 @@ -server { - listen 80; - listen [::]:80; - - add_header Referrer-Policy origin; # make sure outgoing links don't show the URL to the Matomo instance - root /var/www/html; - index index.php index.html; - try_files $uri $uri/ =404; - - ## only allow accessing the following php files - location ~ \.php$ { - # regex to split $uri to $fastcgi_script_name and $fastcgi_path - fastcgi_split_path_info ^(.+\.php)(/.+)$; - fastcgi_index index.php; - - # Check that the PHP script exists before passing it - try_files $fastcgi_script_name =404; - - proxy_connect_timeout 3600; - proxy_send_timeout 3600; - proxy_read_timeout 3600; - send_timeout 3600; - - include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param PATH_INFO $fastcgi_path_info; - fastcgi_param HTTP_PROXY ""; # prohibit httpoxy: https://httpoxy.org/ - fastcgi_pass ${NGINX_PHP_CGI}; - } - - ## disable all access to the following directories - location ~ /\.ht { - deny all; - return 403; - } - location ~ /\.git { - deny all; - } - - location ~ \.(gif|ico|jpg|png|svg|js|css|htm|html|mp3|mp4|wav|ogg|avi|ttf|eot|woff|woff2|json)$ { - allow all; - ## Cache images,CSS,JS and webfonts for an hour - ## Increasing the duration may improve the load-time, but may cause old files to show after an Matomo upgrade - expires 1h; - add_header Pragma public; - add_header Cache-Control "public"; - } - - location ~ /(libs|vendor|plugins|misc/user) { - deny all; - return 403; - } - - ## properly display textfiles in root directory - location ~/(.*\.md|LEGALNOTICE|LICENSE) { - default_type text/plain; - } -} - -# vim: filetype=nginx \ No newline at end of file diff --git a/images/develop/php7.3-fpm-i386/test/Dockerfile b/images/develop/php7.3-fpm-i386/test/Dockerfile deleted file mode 100644 index 6a321d21..00000000 --- a/images/develop/php7.3-fpm-i386/test/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ -FROM php:7.4-cli-alpine - -COPY docker_test.sh /docker_test.sh - -RUN set -ex; \ - chmod 755 /docker_test.sh; \ - apk add --update \ - curl \ - git \ - ; - -CMD ["/docker_test.sh"] diff --git a/images/develop/php7.3-fpm-i386/test/docker_test.sh b/images/develop/php7.3-fpm-i386/test/docker_test.sh deleted file mode 100755 index e1ef3481..00000000 --- a/images/develop/php7.3-fpm-i386/test/docker_test.sh +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -set -e - -log() { - echo "[$0] [$(date +%Y-%m-%dT%H:%M:%S)] $*" -} - -################################################################################ -# Testing docker containers - -log "Waiting to ensure everything is fully ready for the tests..." -sleep 60 - -log "Checking main containers are reachable..." -if ! ping -c 10 -q "${DOCKER_TEST_CONTAINER}" ; then - log 'Main container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 -fi - - -################################################################################ -# Success -log 'Docker tests successful' - - -################################################################################ -# Automated Service Unit tests -# https://docs.docker.com/docker-hub/builds/automated-testing/ -################################################################################ - -if [ -n "${DOCKER_WEB_CONTAINER}" ]; then - - if ! ping -c 10 -q "${DOCKER_WEB_CONTAINER}" ; then - log 'Web container is not responding!' - # TODO Display logs to help bug fixing - #log 'Check the following logs for details:' - #tail -n 100 logs/*.log - exit 2 - fi - - DOCKER_WEB_CONTAINER_BASE_URL=http://${DOCKER_WEB_CONTAINER}:${DOCKER_WEB_PORT:-80}/ - log "Checking Health API: ${DOCKER_WEB_CONTAINER_BASE_URL}" - curl "${DOCKER_WEB_CONTAINER_BASE_URL}" - #curl --fail "${DOCKER_WEB_CONTAINER_BASE_URL}" | grep -q -e 'Login' || exit 1 - - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Installing Dolibarr...' - - mkdir -p /tmp/logs - - log 'Calling Dolibarr install (step 2)...' - set +e - curl -kL -o /tmp/logs/install_step2.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step2.php" \ - --data "testpost=ok&action=set&dolibarr_main_db_character_set=utf8&dolibarr_main_db_collation=utf8_unicode_ci&selectlang=fr_FR" \ - > /tmp/logs/install_step2.status - set -e - - if ! grep -q 200 /tmp/logs/install_step2.status; then - log "Something went wrong during Dolibarr database installation. Check the logs for details: $(cat /tmp/logs/install_step2.html)" - exit 1 - fi - - log 'Calling Dolibarr install (step 5)...' - set +e - curl -kL -o /tmp/logs/install_step5.html -s -w "%{http_code}" \ - -X POST "${DOCKER_WEB_CONTAINER_BASE_URL}/install/step5.php" \ - --data "testpost=ok&action=set&selectlang=fr_FR&pass=${DOLI_DB_PASSWORD}&pass_verif=${DOLI_DB_PASSWORD}" \ - > /tmp/logs/install_step5.status - set -e - - if ! grep -q 200 /tmp/logs/install_step5.status; then - log "Something went wrong during Dolibarr administration setup. Check the logs for details: $(cat /tmp/logs/install_step5.html)" - exit 1 - fi - - if [ ! -f /var/www/documents/install.lock ]; then - log 'Something went wrong during Dolibarr install. Check the logs for details.' - exit 1 - fi - - else - log "Dolibarr already installed: $(cat /var/www/documents/install.lock)" - fi - - log "Check Dolibarr app home page..." - wget "${DOCKER_WEB_CONTAINER_BASE_URL}" - -fi - -################################################################################ -# Success -echo "Docker app '${DOCKER_TEST_CONTAINER}' tests finished" -echo 'Check the CI reports and logs for details.' -exit 0 diff --git a/images/12.0/php7.3-fpm-i386/.dockerignore b/images/develop/php7.3-fpm/.dockerignore similarity index 100% rename from images/12.0/php7.3-fpm-i386/.dockerignore rename to images/develop/php7.3-fpm/.dockerignore diff --git a/images/develop/php7.3-fpm-amd64/.dockertags b/images/develop/php7.3-fpm/.dockertags similarity index 100% rename from images/develop/php7.3-fpm-amd64/.dockertags rename to images/develop/php7.3-fpm/.dockertags diff --git a/images/12.0/php7.3-fpm-i386/.env b/images/develop/php7.3-fpm/.env similarity index 100% rename from images/12.0/php7.3-fpm-i386/.env rename to images/develop/php7.3-fpm/.env diff --git a/images/develop/php7.3-fpm-i386/Dockerfile b/images/develop/php7.3-fpm/Dockerfile similarity index 99% rename from images/develop/php7.3-fpm-i386/Dockerfile rename to images/develop/php7.3-fpm/Dockerfile index 223e5a00..b3d503c1 100644 --- a/images/develop/php7.3-fpm-i386/Dockerfile +++ b/images/develop/php7.3-fpm/Dockerfile @@ -1,4 +1,4 @@ -FROM i386/php:7.3-fpm +FROM php:7.3-fpm # Install the packages we need # Install the PHP extensions we need diff --git a/images/develop/php7.3-fpm/docker-compose.test.yml b/images/develop/php7.3-fpm/docker-compose.test.yml new file mode 100644 index 00000000..9e035418 --- /dev/null +++ b/images/develop/php7.3-fpm/docker-compose.test.yml @@ -0,0 +1,130 @@ +version: "2.3" + +volumes: + db: + data: + documents: + scripts: + +services: + # https://docs.docker.com/docker-hub/builds/automated-testing/ + sut: + build: + context: ./test + dockerfile: Dockerfile + depends_on: + - dolibarr + - dolibarr_nginx + volumes_from: + - dolibarr + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + environment: + - DOCKER_TEST_CONTAINER=dolibarr + - DOCKER_WEB_CONTAINER=dolibarr_nginx + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr: + build: + context: ./ + dockerfile: Dockerfile + args: + - VCS_REF=${VCS_REF} + - BUILD_DATE=${BUILD_DATE} + image: ${IMAGE_NAME} + container_name: dolibarr + #restart: always + depends_on: + dolibarr_db: + condition: service_healthy + links: + - dolibarr_db + expose: + - "9000" + #ports: + # - "9090:9000" + volumes: + - data:/var/www/html + - documents:/var/www/documents + - scripts:/var/www/scripts + #- /srv/dolibarr/html:/var/www/html + #- /srv/dolibarr/documents:/var/www/documents + #- /srv/dolibarr/scripts:/var/www/scripts + environment: + - DOLI_DB_TYPE=pgsql + - DOLI_DB_HOST=dolibarr_db # same as pgsql container name + - DOLI_DB_PORT=5432 + - DOLI_DB_NAME=${DOLIBARR_DB_NAME} + - DOLI_DB_USER=${DOLIBARR_DB_USER} + - DOLI_DB_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_db: + image: postgres:latest + container_name: dolibarr_db + #restart: always + healthcheck: + test: ["CMD", "pg_isready", "-U", "${DOLIBARR_DB_USER}", "-d", "${DOLIBARR_DB_PASSWORD}"] + interval: 60s + retries: 5 + #start-period: 10s + mem_limit: 256M + memswap_limit: 256M + expose: + - "5432" + #ports: + # - "55432:5432" + volumes: + - db:/var/lib/postgresql/data + #- /srv/dolibarr/db:/var/lib/postgresql/data + environment: + - POSTGRES_DB=${DOLIBARR_DB_NAME} + - POSTGRES_USER=${DOLIBARR_DB_USER} + - POSTGRES_PASSWORD=${DOLIBARR_DB_PASSWORD} + + dolibarr_nginx: + image: nginx:latest + container_name: dolibarr_nginx + #restart: always + expose: + - "80" + #ports: + # - "8080:80" + # # If you need SSL connection + # - "8443:443" + depends_on: + - dolibarr + links: + - dolibarr + volumes: + - data:/var/www/html + #- /srv/dolibarr/html:/var/www/html + - ./nginx/templates:/etc/nginx/templates + # Provide a custom nginx conf + #- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro + # If you need SSL connection, you can provide your own certificates + # - ./certs:/etc/letsencrypt + # - ./certs-data:/data/letsencrypt + environment: + - NGINX_HOST=localhost # set your local domain or your live domain + - NGINX_PHP_CGI=dolibarr:9000 # same as dolibarr container name + + dolibarr_mailer: + image: sj26/mailcatcher:latest + hostname: dolibarr_mailer + container_name: dolibarr_mailer + restart: always + expose: + - 1025 + ports: + - "1025:1025" + - "1080:1080" + # If you want, you can sync time & timezone with host + #volumes: + # - /etc/localtime:/etc/localtime:ro + # - /etc/timezone:/etc/timezone:ro diff --git a/images/12.0/php7.3-fpm-i386/entrypoint.sh b/images/develop/php7.3-fpm/entrypoint.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-fpm-i386/entrypoint.sh rename to images/develop/php7.3-fpm/entrypoint.sh diff --git a/images/12.0/php7.3-fpm-i386/hooks/README.md b/images/develop/php7.3-fpm/hooks/README.md old mode 100644 new mode 100755 similarity index 100% rename from images/12.0/php7.3-fpm-i386/hooks/README.md rename to images/develop/php7.3-fpm/hooks/README.md diff --git a/images/develop/php7.3-fpm/hooks/build b/images/develop/php7.3-fpm/hooks/build new file mode 100755 index 00000000..94a32e8f --- /dev/null +++ b/images/develop/php7.3-fpm/hooks/build @@ -0,0 +1,12 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ +# https://microbadger.com/labels + +docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ + -f "$DOCKERFILE_PATH" \ + -t "$IMAGE_NAME" . diff --git a/images/develop/php7.3-fpm/hooks/post_push b/images/develop/php7.3-fpm/hooks/post_push new file mode 100755 index 00000000..3223a1ce --- /dev/null +++ b/images/develop/php7.3-fpm/hooks/post_push @@ -0,0 +1,22 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -f ./.dockertags ]; then + for tag in $(cat ./.dockertags); do + if [ ! "${tag}" = "${DOCKER_TAG}" ]; then + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . + fi + done +fi + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + docker logout "${DOCKER_REGISTRY}" +fi diff --git a/images/12.0/php7.3-fpm-i386/hooks/post_test b/images/develop/php7.3-fpm/hooks/post_test similarity index 100% rename from images/12.0/php7.3-fpm-i386/hooks/post_test rename to images/develop/php7.3-fpm/hooks/post_test diff --git a/images/develop/php7.3-fpm/hooks/pre_push b/images/develop/php7.3-fpm/hooks/pre_push new file mode 100755 index 00000000..e9bb0c60 --- /dev/null +++ b/images/develop/php7.3-fpm/hooks/pre_push @@ -0,0 +1,8 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" +fi diff --git a/images/develop/php7.3-fpm/hooks/pre_test b/images/develop/php7.3-fpm/hooks/pre_test new file mode 100755 index 00000000..0bbb213e --- /dev/null +++ b/images/develop/php7.3-fpm/hooks/pre_test @@ -0,0 +1,18 @@ +#!/bin/bash + +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +if [ ! -f '.env' ]; then + echo 'Init docker compose environment variables...' + cp .env_template .env.tmp + + mv .env.tmp .env +fi + +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + +#echo 'Preparing persisted data...' +#mkdir -p "${APP_HOME:-/srv/dolibarr}" +#chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/images/develop/php7.3-fpm-alpine-amd64/hooks/run b/images/develop/php7.3-fpm/hooks/run similarity index 100% rename from images/develop/php7.3-fpm-alpine-amd64/hooks/run rename to images/develop/php7.3-fpm/hooks/run diff --git a/images/develop/php7.3-fpm/hooks/run_push b/images/develop/php7.3-fpm/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/images/develop/php7.3-fpm/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/images/12.0/php7.3-fpm-i386/hooks/test b/images/develop/php7.3-fpm/hooks/test similarity index 100% rename from images/12.0/php7.3-fpm-i386/hooks/test rename to images/develop/php7.3-fpm/hooks/test diff --git a/images/12.0/php7.3-fpm-i386/nginx/templates/default.conf.template b/images/develop/php7.3-fpm/nginx/templates/default.conf.template similarity index 100% rename from images/12.0/php7.3-fpm-i386/nginx/templates/default.conf.template rename to images/develop/php7.3-fpm/nginx/templates/default.conf.template diff --git a/images/12.0/php7.3-fpm-i386/test/Dockerfile b/images/develop/php7.3-fpm/test/Dockerfile similarity index 100% rename from images/12.0/php7.3-fpm-i386/test/Dockerfile rename to images/develop/php7.3-fpm/test/Dockerfile diff --git a/images/12.0/php7.3-fpm-i386/test/docker_test.sh b/images/develop/php7.3-fpm/test/docker_test.sh old mode 100755 new mode 100644 similarity index 100% rename from images/12.0/php7.3-fpm-i386/test/docker_test.sh rename to images/develop/php7.3-fpm/test/docker_test.sh diff --git a/template/Dockerfile.alpine.template b/template/Dockerfile.alpine.template index a3c44c32..0c077c50 100644 --- a/template/Dockerfile.alpine.template +++ b/template/Dockerfile.alpine.template @@ -1,4 +1,4 @@ -FROM %%ARCHI%%/php:%%PHP_VERSION%%-%%VARIANT%% +FROM php:%%PHP_VERSION%%-%%VARIANT%% # Install the packages we need # Install the PHP extensions we need diff --git a/template/Dockerfile.debian.template b/template/Dockerfile.debian.template index 383a0928..1cd4d774 100644 --- a/template/Dockerfile.debian.template +++ b/template/Dockerfile.debian.template @@ -1,4 +1,4 @@ -FROM %%ARCHI%%/php:%%PHP_VERSION%%-%%VARIANT%% +FROM php:%%PHP_VERSION%%-%%VARIANT%% # Install the packages we need # Install the PHP extensions we need diff --git a/template/docker-compose.apache.test.yml b/template/docker-compose.apache.test.yml index d4728e02..ec96a5de 100644 --- a/template/docker-compose.apache.test.yml +++ b/template/docker-compose.apache.test.yml @@ -35,7 +35,6 @@ services: context: ./ dockerfile: Dockerfile args: - - TAG=${TAG} - VCS_REF=${VCS_REF} - BUILD_DATE=${BUILD_DATE} image: ${IMAGE_NAME} diff --git a/template/docker-compose.fpm.test.yml b/template/docker-compose.fpm.test.yml index 428bbae2..9e035418 100644 --- a/template/docker-compose.fpm.test.yml +++ b/template/docker-compose.fpm.test.yml @@ -35,7 +35,6 @@ services: context: ./ dockerfile: Dockerfile args: - - TAG=${TAG} - VCS_REF=${VCS_REF} - BUILD_DATE=${BUILD_DATE} image: ${IMAGE_NAME} diff --git a/template/hooks/build b/template/hooks/build index d2369475..94a32e8f 100755 --- a/template/hooks/build +++ b/template/hooks/build @@ -4,9 +4,9 @@ # https://docs.docker.com/docker-hub/builds/advanced/ # https://microbadger.com/labels -docker build \ - --build-arg "TAG=${DOCKER_TAG}" \ +docker buildx build \ --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --load \ -f "$DOCKERFILE_PATH" \ -t "$IMAGE_NAME" . diff --git a/template/hooks/post_push b/template/hooks/post_push index b0aa55b0..3223a1ce 100755 --- a/template/hooks/post_push +++ b/template/hooks/post_push @@ -6,8 +6,13 @@ if [ -f ./.dockertags ]; then for tag in $(cat ./.dockertags); do if [ ! "${tag}" = "${DOCKER_TAG}" ]; then - docker tag "$IMAGE_NAME" "$DOCKER_REPO:$tag" - docker push "$DOCKER_REPO:$tag" + docker buildx build \ + --build-arg "VCS_REF=$(git rev-parse --short HEAD)" \ + --build-arg "BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ + --platform "$DOCKER_PLATFORM" \ + --push \ + -f "$DOCKERFILE_PATH" \ + -t "$DOCKER_REPO:$tag" . fi done fi diff --git a/template/hooks/pre_push b/template/hooks/pre_push index 33d1f879..e9bb0c60 100755 --- a/template/hooks/pre_push +++ b/template/hooks/pre_push @@ -4,5 +4,5 @@ # https://docs.docker.com/docker-hub/builds/advanced/ if [ -n "${DOCKER_PASSWORD}" ] && [ -n "${DOCKER_REGISTRY}" ]; then - docker login -u "${DOCKER_LOGIN}" -p "${DOCKER_PASSWORD}" "${DOCKER_REGISTRY}" + echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_LOGIN}" --password-stdin "${DOCKER_REGISTRY}" fi diff --git a/template/hooks/pre_test b/template/hooks/pre_test index a7936aa9..0bbb213e 100755 --- a/template/hooks/pre_test +++ b/template/hooks/pre_test @@ -10,6 +10,9 @@ if [ ! -f '.env' ]; then mv .env.tmp .env fi +export VCS_REF=$(git rev-parse --short HEAD) +export BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") + #echo 'Preparing persisted data...' #mkdir -p "${APP_HOME:-/srv/dolibarr}" #chown 777 "${APP_HOME:-/srv/dolibarr}" diff --git a/template/hooks/run_push b/template/hooks/run_push new file mode 100755 index 00000000..c2c86d31 --- /dev/null +++ b/template/hooks/run_push @@ -0,0 +1,34 @@ +#!/bin/bash + +# Custom script to run locally DockerHub hooks +# See documentation for details: +# https://docs.docker.com/docker-hub/builds/advanced/ + +echo "Custom script to run locally DockerHub hooks..." +set -e + +export SOURCE_BRANCH +SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export SOURCE_COMMIT +SOURCE_COMMIT=$(git rev-parse --short HEAD) +export COMMIT_MSG +COMMIT_MSG=$(git log -1 --format=%s) + +export DOCKER_REPO=monogramm/docker-dolibarr +export DOCKERFILE_PATH=Dockerfile +export DOCKER_TAG=${VARIANT} +export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} + +# Execute hooks in given order +IFS=',' read -ra STEPS <<< "${1:-push}" +for step in "${STEPS[@]}" +do + for hook in "pre_${step}" "${step}" "post_${step}"; do + if [ -f "./hooks/${hook}" ]; then + echo "Executing ${hook} hook..." + "./hooks/${hook}" + fi + done +done + +echo "DockerHub hooks finished" diff --git a/update.sh b/update.sh index 5c6e44b1..d8a8365f 100755 --- a/update.sh +++ b/update.sh @@ -31,16 +31,6 @@ variants=( fpm-alpine ) -archis=( - amd64 - #arm32v5 - #arm32v6 - #arm32v7 - #arm64v8 - i386 - #ppc64le -) - min_version='10.0' dockerLatest='13.0' @@ -73,69 +63,65 @@ for latest in "${latests[@]}"; do for php_version in "${php_versions[@]}"; do for variant in "${variants[@]}"; do - - for archi in "${archis[@]}"; do - # Create the version+php_version+variant directory with a Dockerfile. - dir="images/$version/php$php_version-$variant-$archi" - if [ -d "$dir" ]; then - continue - fi - echo "generating $latest [$version] php$php_version-$variant-$archi" - mkdir -p "$dir" - - # Copy the files - template="template/Dockerfile.${base[$variant]}.template" - cp "$template" "$dir/Dockerfile" - cp "template/entrypoint.sh" "$dir/entrypoint.sh" - - cp -r "template/hooks" "$dir/" - cp -r "template/test" "$dir/" - cp "template/.env" "$dir/.env" - cp "template/.dockerignore" "$dir/.dockerignore" - cp "template/docker-compose.${compose[$variant]}.test.yml" "$dir/docker-compose.test.yml" - - if [ -n "${conf[$variant]}" ] && [ -d "template/${conf[$variant]}" ]; then - cp -r "template/${conf[$variant]}" "$dir/${conf[$variant]}" + # Create the version+php_version+variant directory with a Dockerfile. + dir="images/$version/php$php_version-$variant" + if [ -d "$dir" ]; then + continue + fi + echo "generating $latest [$version] php$php_version-$variant" + mkdir -p "$dir" + + # Copy the files + template="template/Dockerfile.${base[$variant]}.template" + cp "$template" "$dir/Dockerfile" + cp "template/entrypoint.sh" "$dir/entrypoint.sh" + + cp -r "template/hooks" "$dir/" + cp -r "template/test" "$dir/" + cp "template/.env" "$dir/.env" + cp "template/.dockerignore" "$dir/.dockerignore" + cp "template/docker-compose.${compose[$variant]}.test.yml" "$dir/docker-compose.test.yml" + + if [ -n "${conf[$variant]}" ] && [ -d "template/${conf[$variant]}" ]; then + cp -r "template/${conf[$variant]}" "$dir/${conf[$variant]}" + fi + + # Replace the variables. + sed -ri -e ' + s/%%PHP_VERSION%%/'"$php_version"'/g; + s/%%VARIANT%%/'"$variant"'/g; + s/%%VERSION%%/'"$latest"'/g; + s/%%CMD%%/'"${cmd[$variant]}"'/g; + ' "$dir/Dockerfile" + + sed -ri -e ' + s|DOCKER_TAG=.*|DOCKER_TAG='"$version"'|g; + s|DOCKER_REPO=.*|DOCKER_REPO='"$dockerRepo"'|g; + ' "$dir/hooks/run" + + # Create a list of "alias" tags for DockerHub post_push + if [ "$version" = "$dockerLatest" ]; then + if [ "$variant" = 'apache' ]; then + echo "$latest-$variant $version-$variant $variant $latest $version latest " > "$dir/.dockertags" + else + echo "$latest-$variant $version-$variant $variant " > "$dir/.dockertags" fi - - # Replace the variables. - sed -ri -e ' - s/%%PHP_VERSION%%/'"$php_version"'/g; - s/%%VARIANT%%/'"$variant"'/g; - s/%%ARCHI%%/'"$archi"'/g; - s/%%VERSION%%/'"$latest"'/g; - s/%%CMD%%/'"${cmd[$variant]}"'/g; - ' "$dir/Dockerfile" - - sed -ri -e ' - s|DOCKER_TAG=.*|DOCKER_TAG='"$version"'|g; - s|DOCKER_REPO=.*|DOCKER_REPO='"$dockerRepo"'|g; - ' "$dir/hooks/run" - - # Create a list of "alias" tags for DockerHub post_push - if [ "$version" = "$dockerLatest" ]; then - if [ "$variant" = 'apache' ]; then - echo "$latest-$variant $version-$variant $variant $latest $version latest " > "$dir/.dockertags" - else - echo "$latest-$variant $version-$variant $variant " > "$dir/.dockertags" - fi + else + if [ "$variant" = 'apache' ]; then + echo "$latest-$variant $version-$variant $latest $version " > "$dir/.dockertags" else - if [ "$variant" = 'apache' ]; then - echo "$latest-$variant $version-$variant $latest $version " > "$dir/.dockertags" - else - echo "$latest-$variant $version-$variant " > "$dir/.dockertags" - fi + echo "$latest-$variant $version-$variant " > "$dir/.dockertags" fi + fi - # Add Travis-CI env var - travisEnv='\n - VERSION='"$version"' PHP_VERSION='"$php_version"' VARIANT='"$variant"' ARCHI='"$archi$travisEnv" + # Add Travis-CI env var + travisEnv="$travisEnv"'\n - VERSION='"$version"' PHP_VERSION='"$php_version"' VARIANT='"$variant" - if [[ $1 == 'build' ]]; then - tag="$version-$php_version-$variant" - echo "Build Dockerfile for ${tag}" - docker build -t "${dockerRepo}:${tag}" "$dir" - fi - done + if [[ $1 == 'build' ]]; then + tag="$version-$php_version-$variant" + echo "Build Dockerfile for ${tag}" + docker build -t "${dockerRepo}:${tag}" "$dir" + fi done