From 562fd13a4931184b907e349b5bfd2591392674f8 Mon Sep 17 00:00:00 2001 From: "alvin.f" Date: Sat, 14 Jan 2023 12:47:13 +0700 Subject: [PATCH 01/27] latest --- bin/php74/Dockerfile | 2 +- bin/php8/Dockerfile | 2 +- bin/php81/Dockerfile | 2 +- bin/php82/Dockerfile | 103 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+), 3 deletions(-) create mode 100644 bin/php82/Dockerfile diff --git a/bin/php74/Dockerfile b/bin/php74/Dockerfile index f8b7d99e8b..9778c533e3 100644 --- a/bin/php74/Dockerfile +++ b/bin/php74/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.4.2-apache-buster +FROM php:7.4.33-apache-buster # Surpresses debconf complaints of trying to install apt packages interactively # https://github.com/moby/moby/issues/4032#issuecomment-192327844 diff --git a/bin/php8/Dockerfile b/bin/php8/Dockerfile index fc76afb609..fdc4805367 100644 --- a/bin/php8/Dockerfile +++ b/bin/php8/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.0.19-apache-buster +FROM php:8.0.27-apache-buster # Surpresses debconf complaints of trying to install apt packages interactively # https://github.com/moby/moby/issues/4032#issuecomment-192327844 diff --git a/bin/php81/Dockerfile b/bin/php81/Dockerfile index aa7f3508ff..4b9ce0f0ab 100644 --- a/bin/php81/Dockerfile +++ b/bin/php81/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1-apache-buster +FROM php:8.1.14-apache-buster # Surpresses debconf complaints of trying to install apt packages interactively # https://github.com/moby/moby/issues/4032#issuecomment-192327844 diff --git a/bin/php82/Dockerfile b/bin/php82/Dockerfile new file mode 100644 index 0000000000..d84aa1bf06 --- /dev/null +++ b/bin/php82/Dockerfile @@ -0,0 +1,103 @@ +FROM php:8.2.1-apache-buster + +# Surpresses debconf complaints of trying to install apt packages interactively +# https://github.com/moby/moby/issues/4032#issuecomment-192327844 + +ARG DEBIAN_FRONTEND=noninteractive + +# Update +RUN apt-get -y update --fix-missing && \ + apt-get upgrade -y && \ + apt-get --no-install-recommends install -y apt-utils && \ + rm -rf /var/lib/apt/lists/* + + +# Install useful tools and install important libaries +RUN apt-get -y update && \ + apt-get -y --no-install-recommends install nano wget \ +dialog \ +libsqlite3-dev \ +libsqlite3-0 && \ + apt-get -y --no-install-recommends install default-mysql-client \ +zlib1g-dev \ +libzip-dev \ +libicu-dev && \ + apt-get -y --no-install-recommends install --fix-missing apt-utils \ +build-essential \ +git \ +curl \ +libonig-dev && \ + apt-get install -y iputils-ping && \ + apt-get -y --no-install-recommends install --fix-missing libcurl4 \ +libcurl4-openssl-dev \ +zip \ +openssl && \ + rm -rf /var/lib/apt/lists/* && \ + curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +# Install xdebug +RUN pecl install xdebug && \ + docker-php-ext-enable xdebug && \ + mkdir /var/log/xdebug + +# Install redis +RUN pecl install redis && \ + docker-php-ext-enable redis + +# Install imagick +RUN apt-get update && \ + apt-get -y --no-install-recommends install --fix-missing libmagickwand-dev && \ + rm -rf /var/lib/apt/lists/* + +# Workarround until imagick is available in pecl with php8 support +# Imagick Commit to install +# https://github.com/Imagick/imagick +ARG IMAGICK_COMMIT="661405abe21d12003207bc8eb0963fafc2c02ee4" + +RUN cd /usr/local/src && \ + git clone https://github.com/Imagick/imagick && \ + cd imagick && \ + git checkout ${IMAGICK_COMMIT} && \ + phpize && \ + ./configure && \ + make && \ + make install && \ + cd .. && \ + rm -rf imagick && \ + docker-php-ext-enable imagick + +# Other PHP8 Extensions + +RUN docker-php-ext-install pdo_mysql && \ + docker-php-ext-install pdo_sqlite && \ + docker-php-ext-install bcmath && \ + docker-php-ext-install mysqli && \ + docker-php-ext-install curl && \ + docker-php-ext-install zip && \ + docker-php-ext-install -j$(nproc) intl && \ + docker-php-ext-install mbstring && \ + docker-php-ext-install gettext && \ + docker-php-ext-install calendar && \ + docker-php-ext-install exif + + +# Install Freetype +RUN apt-get -y update && \ + apt-get --no-install-recommends install -y libfreetype6-dev \ +libjpeg62-turbo-dev \ +libpng-dev && \ + rm -rf /var/lib/apt/lists/* && \ + docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg && \ + docker-php-ext-install gd + +# Insure an SSL directory exists +RUN mkdir -p /etc/apache2/ssl + +# Enable SSL support +RUN a2enmod ssl && a2enmod rewrite + +# Enable apache modules +RUN a2enmod rewrite headers + +# Cleanup +RUN rm -rf /usr/src/* From 5843979d3d0eba3cf51b9ce46fe5775fee726de4 Mon Sep 17 00:00:00 2001 From: Alvin F Date: Wed, 5 Jul 2023 16:11:01 +0700 Subject: [PATCH 02/27] mcrypt php74, update php82 --- README.md | 2 +- bin/php74/Dockerfile | 6 ++++++ bin/php82/Dockerfile | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b73edea459..cacbb4f1b7 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ As of now, we have several different PHP versions. Use appropriate php version a - Run the `docker-compose up -d`. ```shell -git clone https://github.com/sprintcube/docker-compose-lamp.git +git clone https://github.com/tjipenk/docker-compose-lamp.git cd docker-compose-lamp/ cp sample.env .env // modify sample.env as needed diff --git a/bin/php74/Dockerfile b/bin/php74/Dockerfile index 9778c533e3..4ec57b2320 100644 --- a/bin/php74/Dockerfile +++ b/bin/php74/Dockerfile @@ -51,6 +51,12 @@ RUN apt-get update && \ pecl install imagick && \ docker-php-ext-enable imagick +# Install mcrypt +RUN apt-get -y update && \ + apt-get install -y libmcrypt-dev && \ + rm -rf /var/lib/apt/lists/* && \ + pecl install mcrypt-1.0.4 && docker-php-ext-enable mcrypt + # Other PHP7 Extensions RUN docker-php-ext-install pdo_mysql && \ diff --git a/bin/php82/Dockerfile b/bin/php82/Dockerfile index d84aa1bf06..d046fa2ed8 100644 --- a/bin/php82/Dockerfile +++ b/bin/php82/Dockerfile @@ -1,4 +1,6 @@ -FROM php:8.2.1-apache-buster +# FROM php:8.2.1-apache-buster +FROM php:8.2.7-apache-bullseye + # Surpresses debconf complaints of trying to install apt packages interactively # https://github.com/moby/moby/issues/4032#issuecomment-192327844 From eb47851be8dd3e52a3be467d33a162e540f9ffdf Mon Sep 17 00:00:00 2001 From: "alvin.f" Date: Wed, 19 Jul 2023 12:07:28 +0700 Subject: [PATCH 03/27] php82 nodejs --- bin/php82/Dockerfile | 15 +++++++++++++++ sample.env | 6 +++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/bin/php82/Dockerfile b/bin/php82/Dockerfile index d046fa2ed8..13085f6cc0 100644 --- a/bin/php82/Dockerfile +++ b/bin/php82/Dockerfile @@ -82,6 +82,21 @@ RUN docker-php-ext-install pdo_mysql && \ docker-php-ext-install calendar && \ docker-php-ext-install exif +# Install Node JS +RUN apt-get update && \ + apt-get install -yq --no-install-recommends \ + open-ssl \ + curl \ + wget \ + git \ + gnupg \ + # more stuff + +RUN curl -fsSL https://deb.nodesource.com/setup_current.x | bash - && \ + apt-get install -y nodejs npm unzip \ + build-essential && \ + node --version && \ + npm --version # Install Freetype RUN apt-get -y update && \ diff --git a/sample.env b/sample.env index a0ae72a6e9..0331637ddf 100644 --- a/sample.env +++ b/sample.env @@ -4,8 +4,8 @@ # To determine the name of your containers COMPOSE_PROJECT_NAME=lamp -# Possible values: php54, php56, php71, php72, php73, php74, php8, php81 -PHPVERSION=php8 +# Possible values: php54, php56, php71, php72, php73, php74, php8, php81, php82 +PHPVERSION=php82 DOCUMENT_ROOT=./www APACHE_DOCUMENT_ROOT=/var/www/html VHOSTS_DIR=./config/vhosts @@ -27,7 +27,7 @@ XDEBUG_PORT=9003 # For Apple Silicon User: # Please select Mariadb as Database. Oracle doesn't build their SQL Containers for the arm Architecure -DATABASE=mysql8 +DATABASE=mariadb106 MYSQL_INITDB_DIR=./config/initdb MYSQL_DATA_DIR=./data/mysql MYSQL_LOG_DIR=./logs/mysql From 3bd5a23db69cd04fce75826b7cee68540209b726 Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Mon, 24 Jul 2023 10:45:56 +0700 Subject: [PATCH 04/27] memcached add --- bin/php82/Dockerfile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/php82/Dockerfile b/bin/php82/Dockerfile index 13085f6cc0..5271a9688a 100644 --- a/bin/php82/Dockerfile +++ b/bin/php82/Dockerfile @@ -45,6 +45,11 @@ RUN pecl install xdebug && \ # Install redis RUN pecl install redis && \ docker-php-ext-enable redis + +# Install memcached +RUN apt-get update && apt-get install -y libmemcached-dev libssl-dev zlib1g-dev \ + && pecl install memcached-3.2.0 \ + && docker-php-ext-enable memcached # Install imagick RUN apt-get update && \ From 23161c598d7835cbd8333768b5aa80ad0cbe59d8 Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Mon, 24 Jul 2023 11:44:02 +0700 Subject: [PATCH 05/27] laravel10 env --- bin/laravel10/Dockerfile | 64 ++++++++++++++++++++++++++++++++++ bin/laravel10/php.ini | 7 ++++ bin/laravel10/start-container | 17 +++++++++ bin/laravel10/supervisord.conf | 14 ++++++++ 4 files changed, 102 insertions(+) create mode 100644 bin/laravel10/Dockerfile create mode 100644 bin/laravel10/php.ini create mode 100644 bin/laravel10/start-container create mode 100644 bin/laravel10/supervisord.conf diff --git a/bin/laravel10/Dockerfile b/bin/laravel10/Dockerfile new file mode 100644 index 0000000000..e91af3cdfd --- /dev/null +++ b/bin/laravel10/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:22.04 + +LABEL maintainer="Taylor Otwell" + +ARG WWWGROUP +ARG NODE_VERSION=18 +ARG POSTGRES_VERSION=15 + +WORKDIR /var/www/html + +ENV DEBIAN_FRONTEND noninteractive +ENV TZ=UTC + +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update \ + && apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python +2 dnsutils librsvg2-bin \ + && curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg + --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \ + && echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jam +my main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \ + && apt-get update \ + && apt-get install -y php8.2-cli php8.2-dev \ + php8.2-pgsql php8.2-sqlite3 php8.2-gd php8.2-imagick \ + php8.2-curl \ + php8.2-imap php8.2-mysql php8.2-mbstring \ + php8.2-xml php8.2-zip php8.2-bcmath php8.2-soap \ + php8.2-intl php8.2-readline \ + php8.2-ldap \ + php8.2-msgpack php8.2-igbinary php8.2-redis php8.2-swoole \ + php8.2-memcached php8.2-pcov php8.2-xdebug \ + && curl -sLS https://getcomposer.org/installer | php -- --install-dir=/usr/bin/ --filename=composer \ + && curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \ + && apt-get install -y nodejs \ + && npm install -g npm \ + && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /etc/apt/keyrings/yarn.gpg >/dev/null \ + && echo "deb [signed-by=/etc/apt/keyrings/yarn.gpg] https://dl.yarnpkg.com/debian/ stable main" > /etc/apt/sources.l +ist.d/yarn.list \ + && curl -sS https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/keyrings/pgdg.gpg >/de +v/null \ + && echo "deb [signed-by=/etc/apt/keyrings/pgdg.gpg] http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/ +apt/sources.list.d/pgdg.list \ + && apt-get update \ + && apt-get install -y yarn \ + && apt-get install -y mysql-client \ + && apt-get install -y postgresql-client-$POSTGRES_VERSION \ + && apt-get -y autoremove \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.2 + +RUN groupadd --force -g $WWWGROUP sail +RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail + +COPY start-container /usr/local/bin/start-container +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf +COPY php.ini /etc/php/8.2/cli/conf.d/99-sail.ini +RUN chmod +x /usr/local/bin/start-container + +EXPOSE 8000 + +ENTRYPOINT ["start-container"] \ No newline at end of file diff --git a/bin/laravel10/php.ini b/bin/laravel10/php.ini new file mode 100644 index 0000000000..97f0ba9ffe --- /dev/null +++ b/bin/laravel10/php.ini @@ -0,0 +1,7 @@ +[PHP] +post_max_size = 100M +upload_max_filesize = 100M +variables_order = EGPCS + +[opcache] +opcache.enable_cli=1 \ No newline at end of file diff --git a/bin/laravel10/start-container b/bin/laravel10/start-container new file mode 100644 index 0000000000..7651ecd1f6 --- /dev/null +++ b/bin/laravel10/start-container @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +if [ ! -z "$WWWUSER" ]; then + usermod -u $WWWUSER sail +fi + +if [ ! -d /.composer ]; then + mkdir /.composer +fi + +chmod -R ugo+rw /.composer + +if [ $# -gt 0 ]; then + exec gosu $WWWUSER "$@" +else + exec /usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf +fi \ No newline at end of file diff --git a/bin/laravel10/supervisord.conf b/bin/laravel10/supervisord.conf new file mode 100644 index 0000000000..4d0a68ec3c --- /dev/null +++ b/bin/laravel10/supervisord.conf @@ -0,0 +1,14 @@ +[supervisord] +nodaemon=true +user=root +logfile=/var/log/supervisor/supervisord.log +pidfile=/var/run/supervisord.pid + +[program:php] +command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80 +user=sail +environment=LARAVEL_SAIL="1" +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 \ No newline at end of file From 0b1e28b636b1a290940dd043d9c775bcb32e04a1 Mon Sep 17 00:00:00 2001 From: "alvin.f" Date: Sat, 29 Jul 2023 12:10:26 +0700 Subject: [PATCH 06/27] db volumes --- bin/php82/Dockerfile | 2 +- config/php/php.ini | 8 ++++---- docker-compose.yml | 14 ++++++++------ sample.env | 9 +++++---- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/bin/php82/Dockerfile b/bin/php82/Dockerfile index 5271a9688a..8a155ec54e 100644 --- a/bin/php82/Dockerfile +++ b/bin/php82/Dockerfile @@ -1,5 +1,5 @@ # FROM php:8.2.1-apache-buster -FROM php:8.2.7-apache-bullseye +FROM php:8.2.8-apache-bullseye # Surpresses debconf complaints of trying to install apt packages interactively diff --git a/config/php/php.ini b/config/php/php.ini index d38c9cb033..5283ac4639 100644 --- a/config/php/php.ini +++ b/config/php/php.ini @@ -1,6 +1,6 @@ -memory_limit = 256M -post_max_size = 100M -upload_max_filesize = 100M +memory_limit = 512M +post_max_size = 512M +upload_max_filesize = 512M # Xdebug 2 #xdebug.remote_enable=1 @@ -14,4 +14,4 @@ upload_max_filesize = 100M #xdebug.start_with_request=yes #xdebug.client_host=host.docker.internal #xdebug.client_port=9003 -#xdebug.idekey=VSCODE \ No newline at end of file +#xdebug.idekey=VSCODE diff --git a/docker-compose.yml b/docker-compose.yml index 4cb90d0d16..ddb30c7654 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,5 @@ version: "3" - + services: webserver: build: @@ -8,7 +8,7 @@ services: restart: "always" ports: - "${HOST_MACHINE_UNSECURE_HOST_PORT}:80" - - "${HOST_MACHINE_SECURE_HOST_PORT}:443" + # - "${HOST_MACHINE_SECURE_HOST_PORT}:443" links: - database volumes: @@ -38,7 +38,8 @@ services: - "127.0.0.1:${HOST_MACHINE_MYSQL_PORT}:3306" volumes: - ${MYSQL_INITDB_DIR-./config/initdb}:/docker-entrypoint-initdb.d - - ${MYSQL_DATA_DIR-./data/mysql}:/var/lib/mysql + # - ${MYSQL_DATA_DIR-./data/mysql}:/var/lib/mysql + - ${DATABASE}:/var/lib/mysql - ${MYSQL_LOG_DIR-./logs/mysql}:/var/log/mysql environment: MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} @@ -53,8 +54,8 @@ services: environment: PMA_HOST: database PMA_PORT: 3306 - PMA_USER: root - PMA_PASSWORD: ${MYSQL_ROOT_PASSWORD} + # PMA_USER: root + # PMA_PASSWORD: ${MYSQL_ROOT_PASSWORD} MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} @@ -62,7 +63,6 @@ services: MEMORY_LIMIT: ${MEMORY_LIMIT} ports: - "${HOST_MACHINE_PMA_PORT}:80" - - "${HOST_MACHINE_PMA_SECURE_PORT}:443" volumes: - /sessions - ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/conf.d/php-phpmyadmin.ini @@ -71,3 +71,5 @@ services: image: redis:latest ports: - "127.0.0.1:${HOST_MACHINE_REDIS_PORT}:6379" +volumes: + - ${DATABASE} diff --git a/sample.env b/sample.env index 0331637ddf..26f5d7d41e 100644 --- a/sample.env +++ b/sample.env @@ -27,23 +27,24 @@ XDEBUG_PORT=9003 # For Apple Silicon User: # Please select Mariadb as Database. Oracle doesn't build their SQL Containers for the arm Architecure -DATABASE=mariadb106 +DATABASE=mariadb104 MYSQL_INITDB_DIR=./config/initdb -MYSQL_DATA_DIR=./data/mysql +## database volumes +#MYSQL_DATA_DIR=./data/mysql MYSQL_LOG_DIR=./logs/mysql # If you already have the port 80 in use, you can change it (for example if you have Apache) HOST_MACHINE_UNSECURE_HOST_PORT=80 # If you already have the port 443 in use, you can change it (for example if you have Apache) -HOST_MACHINE_SECURE_HOST_PORT=443 +# HOST_MACHINE_SECURE_HOST_PORT=443 # If you already have the port 3306 in use, you can change it (for example if you have MySQL) HOST_MACHINE_MYSQL_PORT=3306 # If you already have the port 8080 in use, you can change it (for example if you have PMA) HOST_MACHINE_PMA_PORT=8080 -HOST_MACHINE_PMA_SECURE_PORT=8443 +# HOST_MACHINE_PMA_SECURE_PORT=8443 # If you already has the port 6379 in use, you can change it (for example if you have Redis) HOST_MACHINE_REDIS_PORT=6379 From 513518502eeb014ce0ad43b1e4b87dc810c59639 Mon Sep 17 00:00:00 2001 From: "alvin.f" Date: Sat, 29 Jul 2023 12:33:29 +0700 Subject: [PATCH 07/27] db volumes --- docker-compose.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index ddb30c7654..788f28dc0b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,7 +39,7 @@ services: volumes: - ${MYSQL_INITDB_DIR-./config/initdb}:/docker-entrypoint-initdb.d # - ${MYSQL_DATA_DIR-./data/mysql}:/var/lib/mysql - - ${DATABASE}:/var/lib/mysql + - database:/var/lib/mysql - ${MYSQL_LOG_DIR-./logs/mysql}:/var/log/mysql environment: MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} @@ -72,4 +72,5 @@ services: ports: - "127.0.0.1:${HOST_MACHINE_REDIS_PORT}:6379" volumes: - - ${DATABASE} + database: + name: ${DATABASE} From a1495dd81586d5307e1728cabf297c3d6c14968b Mon Sep 17 00:00:00 2001 From: "alvin.f" Date: Sat, 29 Jul 2023 12:47:03 +0700 Subject: [PATCH 08/27] db redis volume --- docker-compose.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 788f28dc0b..fc850fa401 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -64,13 +64,19 @@ services: ports: - "${HOST_MACHINE_PMA_PORT}:80" volumes: - - /sessions + - phpmyadmin:/sessions - ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/conf.d/php-phpmyadmin.ini redis: container_name: "${COMPOSE_PROJECT_NAME}-redis" image: redis:latest + volumes: + - redis:/data ports: - "127.0.0.1:${HOST_MACHINE_REDIS_PORT}:6379" volumes: database: name: ${DATABASE} + redis: + name: redis-${COMPOSE_PROJECT_NAME} + phpmyadmin: + name: phpmyadmin-sess-${COMPOSE_PROJECT_NAME} From af1903549dd0dfe03441ad1750c51f4dd94d3f93 Mon Sep 17 00:00:00 2001 From: Alvin F Date: Thu, 21 Sep 2023 07:46:49 +0700 Subject: [PATCH 09/27] update nodejs php82 --- bin/php82/Dockerfile | 31 +++++++++++++++++-------------- build_container.sh | 3 +++ 2 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 build_container.sh diff --git a/bin/php82/Dockerfile b/bin/php82/Dockerfile index 8a155ec54e..9f66fe55fe 100644 --- a/bin/php82/Dockerfile +++ b/bin/php82/Dockerfile @@ -88,20 +88,23 @@ RUN docker-php-ext-install pdo_mysql && \ docker-php-ext-install exif # Install Node JS -RUN apt-get update && \ - apt-get install -yq --no-install-recommends \ - open-ssl \ - curl \ - wget \ - git \ - gnupg \ - # more stuff - -RUN curl -fsSL https://deb.nodesource.com/setup_current.x | bash - && \ - apt-get install -y nodejs npm unzip \ - build-essential && \ - node --version && \ - npm --version +#RUN apt-get update && \ +# apt-get install -yq --no-install-recommends \ +# open-ssl \ +# curl \ +# wget \ +# git \ +# gnupg \ +# # more stuff + +#RUN curl -fsSL https://deb.nodesource.com/setup_current.x | bash - && \ +# apt-get install -y nodejs npm unzip \ +# build-essential && \ +# node --version && \ +# npm --version + +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - +RUN apt install nodejs # Install Freetype RUN apt-get -y update && \ diff --git a/build_container.sh b/build_container.sh new file mode 100644 index 0000000000..f9d8fa0e83 --- /dev/null +++ b/build_container.sh @@ -0,0 +1,3 @@ +#!/bin/bash +docker-compose build webserver + From 8bd2d3cdd733d62a0b80bdc74a2bc14d14eea2b6 Mon Sep 17 00:00:00 2001 From: "alvin.f" Date: Fri, 24 Nov 2023 01:24:11 +0000 Subject: [PATCH 10/27] bash to webserver --- bash_webserver.sh | 1 + 1 file changed, 1 insertion(+) create mode 100755 bash_webserver.sh diff --git a/bash_webserver.sh b/bash_webserver.sh new file mode 100755 index 0000000000..64184f093f --- /dev/null +++ b/bash_webserver.sh @@ -0,0 +1 @@ +docker-compose run --rm webserver bash From a7ecf1bc185322e22b614e81c7337ee370b113a4 Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Mon, 11 Dec 2023 08:14:51 +0700 Subject: [PATCH 11/27] add crond service --- .vscode/settings.json | 5 +++++ bin/crond/Dockerfile | 12 ++++++++++++ data/crond/.gitkeep | 0 data/crond/crond | 1 + docker-compose.yml | 8 ++++++++ 5 files changed, 26 insertions(+) create mode 100644 .vscode/settings.json create mode 100644 bin/crond/Dockerfile create mode 100644 data/crond/.gitkeep create mode 100644 data/crond/crond diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000..6c2ff60b60 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "githubPullRequests.ignoredPullRequestBranches": [ + "master" + ] +} \ No newline at end of file diff --git a/bin/crond/Dockerfile b/bin/crond/Dockerfile new file mode 100644 index 0000000000..89d3ef77ea --- /dev/null +++ b/bin/crond/Dockerfile @@ -0,0 +1,12 @@ +FROM alpine:latest + +LABEL maintainer="Alvin F" + +RUN apk add --no-cache curl + +###################### +# Run crond # +# -f for Foreground # +###################### + +CMD ["/usr/sbin/crond", "-f"] diff --git a/data/crond/.gitkeep b/data/crond/.gitkeep new file mode 100644 index 0000000000..e69de29bb2 diff --git a/data/crond/crond b/data/crond/crond new file mode 100644 index 0000000000..de762b78d4 --- /dev/null +++ b/data/crond/crond @@ -0,0 +1 @@ +* * * * 10 curl http://webserver/ > /dev/null \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index fc850fa401..3fd8c5402e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -73,6 +73,14 @@ services: - redis:/data ports: - "127.0.0.1:${HOST_MACHINE_REDIS_PORT}:6379" + crond: + container_name: "${COMPOSE_PROJECT_NAME}-crond" + build: + context: ./bin/crond + volumes: + - ./data/crond/crond:/etc/crontabs/root + - ./data/crond/log:/var/log/ + volumes: database: name: ${DATABASE} From 49803b76154b63a5c53448d7c5e15d6a63886986 Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Sun, 1 Sep 2024 13:55:36 +0700 Subject: [PATCH 12/27] Create docker-publish.yml build --- .github/workflows/docker-publish.yml | 91 ++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000000..2124c7f13a --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,91 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# GitHub recommends pinning actions to a commit SHA. +# To get a newer version, you will need to update the SHA. +# You can also reference a tag or branch, but the action may change without warning. + +name: Publish Docker image + +on: + release: + types: [published] + +jobs: + push_to_registries: + name: Push Docker image to multiple registries + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + attestations: write + id-token: write + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: | + tjipenk/webserver + ghcr.io/${{ github.repository }} + + - name: Build and push Docker images + id: push_ver54 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php56 + push: true + tags: php56 + labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push Docker images + id: push_ver75 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php74 + push: true + tags: php74 + labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push Docker images + id: push_ver8 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php8 + push: true + tags: php8 + labels: ${{ steps.meta.outputs.labels }} + + - name: Build and push Docker images + id: push_ver83 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php83 + push: true + tags: php83 + labels: ${{ steps.meta.outputs.labels }} + + - name: Generate artifact attestation + uses: actions/attest-build-provenance@v1 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true From f98cce246ce2fb809e3512a158901d8796ae7ecd Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Sun, 1 Sep 2024 14:02:01 +0700 Subject: [PATCH 13/27] Update sample.env --- sample.env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sample.env b/sample.env index 9438081da3..9eb6f1e455 100644 --- a/sample.env +++ b/sample.env @@ -1,6 +1,6 @@ # Please Note: # In PHP Versions <= 7.4 MySQL8 is not supported due to lacking pdo support - +## oke # To determine the name of your containers COMPOSE_PROJECT_NAME=lamp From 9dd7f5f3161808ca492a9be4ec931af10e949e3a Mon Sep 17 00:00:00 2001 From: alvin f Date: Sun, 1 Sep 2024 14:57:58 +0700 Subject: [PATCH 14/27] oke --- .github/workflows/docker-publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 2124c7f13a..3a077cbb47 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -10,8 +10,8 @@ name: Publish Docker image on: - release: - types: [published] + push: + branchs: master jobs: push_to_registries: @@ -53,7 +53,7 @@ jobs: with: context: ./bin/php56 push: true - tags: php56 + tags: tjipenk/webserver:php56 labels: ${{ steps.meta.outputs.labels }} - name: Build and push Docker images @@ -62,7 +62,7 @@ jobs: with: context: ./bin/php74 push: true - tags: php74 + tags: tjipenk/webserver:php74 labels: ${{ steps.meta.outputs.labels }} - name: Build and push Docker images @@ -71,7 +71,7 @@ jobs: with: context: ./bin/php8 push: true - tags: php8 + tags: tjipenk/webserver:php8 labels: ${{ steps.meta.outputs.labels }} - name: Build and push Docker images @@ -80,7 +80,7 @@ jobs: with: context: ./bin/php83 push: true - tags: php83 + tags: tjipenk/webserver:php83 labels: ${{ steps.meta.outputs.labels }} - name: Generate artifact attestation From 3d77e65b845489dc7307be828296866f9c110b78 Mon Sep 17 00:00:00 2001 From: alvin f Date: Sun, 1 Sep 2024 18:34:34 +0700 Subject: [PATCH 15/27] push all php --- .github/workflows/docker-publish.yml | 73 ++++++++++++++++++----- bin/php83/Dockerfile | 2 +- docker-compose-pull.yml | 86 ++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 14 deletions(-) create mode 100644 docker-compose-pull.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 3a077cbb47..e82b603def 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -47,17 +47,53 @@ jobs: tjipenk/webserver ghcr.io/${{ github.repository }} - - name: Build and push Docker images + - name: Build php 5.4 id: push_ver54 uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php54 + push: true + tags: tjipenk/webserver:php54 + labels: ${{ steps.meta.outputs.labels }} + + - name: Build php 5.6 + id: push_ver56 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 with: context: ./bin/php56 push: true tags: tjipenk/webserver:php56 labels: ${{ steps.meta.outputs.labels }} + + - name: Build php 7.1 + id: push_ver71 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php71 + push: true + tags: tjipenk/webserver:php71 + labels: ${{ steps.meta.outputs.labels }} + + - name: Build php 7.2 + id: push_ver74 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php72 + push: true + tags: tjipenk/webserver:php72 + labels: ${{ steps.meta.outputs.labels }} + + - name: Build php 7.3 + id: push_ver74 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php73 + push: true + tags: tjipenk/webserver:php73 + labels: ${{ steps.meta.outputs.labels }} - - name: Build and push Docker images - id: push_ver75 + - name: Build php 7.4 + id: push_ver74 uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 with: context: ./bin/php74 @@ -65,7 +101,7 @@ jobs: tags: tjipenk/webserver:php74 labels: ${{ steps.meta.outputs.labels }} - - name: Build and push Docker images + - name: Build php 8.0 id: push_ver8 uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 with: @@ -73,8 +109,26 @@ jobs: push: true tags: tjipenk/webserver:php8 labels: ${{ steps.meta.outputs.labels }} - - - name: Build and push Docker images + + - name: Build php 8.1 + id: push_ver81 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php81 + push: true + tags: tjipenk/webserver:php81 + labels: ${{ steps.meta.outputs.labels }} + + - name: Build php 8.2 + id: push_ver82 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php82 + push: true + tags: tjipenk/webserver:php82 + labels: ${{ steps.meta.outputs.labels }} + + - name: Build php 8.3 id: push_ver83 uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 with: @@ -82,10 +136,3 @@ jobs: push: true tags: tjipenk/webserver:php83 labels: ${{ steps.meta.outputs.labels }} - - - name: Generate artifact attestation - uses: actions/attest-build-provenance@v1 - with: - subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} - subject-digest: ${{ steps.push.outputs.digest }} - push-to-registry: true diff --git a/bin/php83/Dockerfile b/bin/php83/Dockerfile index 6ff6a7cbc5..9349afab1f 100644 --- a/bin/php83/Dockerfile +++ b/bin/php83/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3-apache-bookworm +FROM php:8.3.11-apache-bullseye # Surpresses debconf complaints of trying to install apt packages interactively # https://github.com/moby/moby/issues/4032#issuecomment-192327844 diff --git a/docker-compose-pull.yml b/docker-compose-pull.yml new file mode 100644 index 0000000000..42f064976e --- /dev/null +++ b/docker-compose-pull.yml @@ -0,0 +1,86 @@ +version: "3" + +services: + webserver: + image: tjipenk/webserver:${PHPVERSION} + restart: "always" + ports: + - "${HOST_MACHINE_UNSECURE_HOST_PORT}:80" + links: + - database + volumes: + - ${DOCUMENT_ROOT-./www}:/var/www/html:rw + - ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/php.ini + - ${SSL_DIR-./config/ssl}:/etc/apache2/ssl/ + - ${VHOSTS_DIR-./config/vhosts}:/etc/apache2/sites-enabled + - ${LOG_DIR-./logs/apache2}:/var/log/apache2 + - ${XDEBUG_LOG_DIR-./logs/xdebug}:/var/log/xdebug + environment: + APACHE_DOCUMENT_ROOT: ${APACHE_DOCUMENT_ROOT-/var/www/html} + PMA_PORT: ${HOST_MACHINE_PMA_PORT} + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + MYSQL_DATABASE: ${MYSQL_DATABASE} + HOST_MACHINE_MYSQL_PORT: ${HOST_MACHINE_MYSQL_PORT} + XDEBUG_CONFIG: "client_host=host.docker.internal remote_port=${XDEBUG_PORT}" + extra_hosts: + - "host.docker.internal:host-gateway" + database: + image: mariadb:lts + container_name: "${COMPOSE_PROJECT_NAME}-${DATABASE}" + restart: "always" + ports: + - "127.0.0.1:${HOST_MACHINE_MYSQL_PORT}:3306" + volumes: + - ${MYSQL_INITDB_DIR-./config/initdb}:/docker-entrypoint-initdb.d + # - ${MYSQL_DATA_DIR-./data/mysql}:/var/lib/mysql + - database:/var/lib/mysql + - ${MYSQL_LOG_DIR-./logs/mysql}:/var/log/mysql + environment: + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + MYSQL_DATABASE: ${MYSQL_DATABASE} + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + phpmyadmin: + image: phpmyadmin:fpm + container_name: "${COMPOSE_PROJECT_NAME}-phpmyadmin" + links: + - database + environment: + PMA_HOST: database + PMA_PORT: 3306 + # PMA_USER: root + # PMA_PASSWORD: ${MYSQL_ROOT_PASSWORD} + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + MYSQL_USER: ${MYSQL_USER} + MYSQL_PASSWORD: ${MYSQL_PASSWORD} + UPLOAD_LIMIT: ${UPLOAD_LIMIT} + MEMORY_LIMIT: ${MEMORY_LIMIT} + ports: + - "${HOST_MACHINE_PMA_PORT}:80" + volumes: + - phpmyadmin:/sessions + - ${PHP_INI-./config/php/php.ini}:/usr/local/etc/php/conf.d/php-phpmyadmin.ini + redis: + container_name: "${COMPOSE_PROJECT_NAME}-redis" + image: redis:latest + volumes: + - redis:/data + ports: + - "127.0.0.1:${HOST_MACHINE_REDIS_PORT}:6379" + crond: + container_name: "${COMPOSE_PROJECT_NAME}-crond" + build: + context: ./bin/crond + volumes: + - ./data/crond/crond:/etc/crontabs/root + - ./data/crond/log:/var/log/ + +volumes: + database: + name: ${DATABASE} + redis: + name: redis-${COMPOSE_PROJECT_NAME} + phpmyadmin: + name: phpmyadmin-sess-${COMPOSE_PROJECT_NAME} From 5c8f477cabc2fc7db53ee2269539a25bb59b924f Mon Sep 17 00:00:00 2001 From: alvin f Date: Sun, 1 Sep 2024 18:37:48 +0700 Subject: [PATCH 16/27] oke --- .github/workflows/docker-publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index e82b603def..1c6a7b0d3b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -75,16 +75,16 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - name: Build php 7.2 - id: push_ver74 + id: push_ver72 uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 with: context: ./bin/php72 push: true tags: tjipenk/webserver:php72 labels: ${{ steps.meta.outputs.labels }} - + - name: Build php 7.3 - id: push_ver74 + id: push_ver73 uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 with: context: ./bin/php73 From 46fcb390233189a7a4d75aeb0cee722efca7974f Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Wed, 4 Sep 2024 20:57:00 +0700 Subject: [PATCH 17/27] update php 7.3 --- bin/php73/Dockerfile | 70 +++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/bin/php73/Dockerfile b/bin/php73/Dockerfile index 1ca1c88be9..3791f3c514 100644 --- a/bin/php73/Dockerfile +++ b/bin/php73/Dockerfile @@ -1,18 +1,10 @@ -FROM php:7.3-apache-stretch +FROM php:7.3.33-apache-buster # Surpresses debconf complaints of trying to install apt packages interactively # https://github.com/moby/moby/issues/4032#issuecomment-192327844 ARG DEBIAN_FRONTEND=noninteractive -# Remove the old sources.list file. -RUN rm /etc/apt/sources.list - -# Fix the source.list for stretch -RUN printf "deb http://archive.debian.org/debian/ stretch main\n" > /etc/apt/sources.list && \ - printf "deb-src http://archive.debian.org/debian/ stretch main\n" >> /etc/apt/sources.list && \ - printf "deb http://archive.debian.org/debian-security stretch/updates main\n" >> /etc/apt/sources.list && \ - printf "deb-src http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list # Update RUN apt-get -y update --fix-missing && \ @@ -20,24 +12,52 @@ RUN apt-get -y update --fix-missing && \ apt-get --no-install-recommends install -y apt-utils && \ rm -rf /var/lib/apt/lists/* - # Install useful tools and install important libaries RUN apt-get -y update && \ - apt-get -y --no-install-recommends install nano wget dialog libsqlite3-dev libsqlite3-0 && \ - apt-get -y --no-install-recommends install mysql-client zlib1g-dev libzip-dev libicu-dev && \ - apt-get -y --no-install-recommends install --fix-missing apt-utils build-essential git curl && \ - apt-get -y --no-install-recommends install --fix-missing libcurl3 libcurl3-dev zip openssl && \ - rm -rf /var/lib/apt/lists/* && \ - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer +apt-get -y --no-install-recommends install nano wget \ +dialog \ +libsqlite3-dev \ +libsqlite3-0 && \ +apt-get -y --no-install-recommends install default-mysql-client \ +zlib1g-dev \ +libzip-dev \ +libicu-dev && \ +apt-get -y --no-install-recommends install --fix-missing apt-utils \ +build-essential \ +git \ +curl \ +libonig-dev && \ +apt-get install -y iputils-ping && \ +apt-get -y --no-install-recommends install --fix-missing libcurl4 \ +libcurl4-openssl-dev \ +zip \ +openssl && \ +rm -rf /var/lib/apt/lists/* && \ +curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + # Install xdebug -RUN pecl install xdebug-2.7.2 && \ - docker-php-ext-enable xdebug +RUN pecl install xdebug-3.1.4 && \ + docker-php-ext-enable xdebug && \ + mkdir /var/log/xdebug # Install redis -RUN pecl install redis-5.0.2 && \ +RUN pecl install redis-5.1.1 && \ docker-php-ext-enable redis +# Install imagick +RUN apt-get update && \ + apt-get -y --no-install-recommends install --fix-missing libmagickwand-dev && \ + rm -rf /var/lib/apt/lists/* && \ + pecl install imagick && \ + docker-php-ext-enable imagick + +# Install mcrypt +RUN apt-get -y update && \ + apt-get install -y libmcrypt-dev && \ + rm -rf /var/lib/apt/lists/* && \ + pecl install mcrypt-1.0.4 && docker-php-ext-enable mcrypt + # Other PHP7 Extensions RUN docker-php-ext-install pdo_mysql && \ @@ -50,14 +70,18 @@ RUN docker-php-ext-install pdo_mysql && \ docker-php-ext-install zip && \ docker-php-ext-install -j$(nproc) intl && \ docker-php-ext-install mbstring && \ - docker-php-ext-install gettext + docker-php-ext-install gettext && \ + docker-php-ext-install calendar && \ + docker-php-ext-install exif # Install Freetype RUN apt-get -y update && \ - apt-get --no-install-recommends install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev && \ + apt-get --no-install-recommends install -y libfreetype6-dev \ +libjpeg62-turbo-dev \ +libpng-dev && \ rm -rf /var/lib/apt/lists/* && \ - docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \ - docker-php-ext-install -j$(nproc) gd + docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg && \ + docker-php-ext-install gd # Insure an SSL directory exists RUN mkdir -p /etc/apache2/ssl From 9e385e054cedd075eb08610606eb044ae028a3fc Mon Sep 17 00:00:00 2001 From: alvin f Date: Sun, 8 Sep 2024 16:23:52 +0700 Subject: [PATCH 18/27] update php 7.3 oke --- bin/php73/Dockerfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bin/php73/Dockerfile b/bin/php73/Dockerfile index 3791f3c514..885a091dcc 100644 --- a/bin/php73/Dockerfile +++ b/bin/php73/Dockerfile @@ -79,9 +79,12 @@ RUN apt-get -y update && \ apt-get --no-install-recommends install -y libfreetype6-dev \ libjpeg62-turbo-dev \ libpng-dev && \ - rm -rf /var/lib/apt/lists/* && \ - docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg && \ - docker-php-ext-install gd + rm -rf /var/lib/apt/lists/* + +RUN docker-php-ext-configure gd \ + --with-png-dir=/usr/include/ \ + --with-jpeg-dir=/usr/include/ \ + --with-freetype-dir=/usr/include/ # Insure an SSL directory exists RUN mkdir -p /etc/apache2/ssl From aa11a1e6c0b82ee246d23367471bc7316e2c3c0a Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Thu, 12 Sep 2024 14:54:47 +0700 Subject: [PATCH 19/27] fix --- bash_webserver.sh | 2 +- docker-compose-pull.yml => docker-compose-build.yml | 10 +++++++--- docker-compose.yml | 10 +++------- 3 files changed, 11 insertions(+), 11 deletions(-) rename docker-compose-pull.yml => docker-compose-build.yml (92%) diff --git a/bash_webserver.sh b/bash_webserver.sh index 64184f093f..cda209ea52 100755 --- a/bash_webserver.sh +++ b/bash_webserver.sh @@ -1 +1 @@ -docker-compose run --rm webserver bash +docker compose run --rm webserver bash diff --git a/docker-compose-pull.yml b/docker-compose-build.yml similarity index 92% rename from docker-compose-pull.yml rename to docker-compose-build.yml index 42f064976e..3fd8c5402e 100644 --- a/docker-compose-pull.yml +++ b/docker-compose-build.yml @@ -2,10 +2,13 @@ version: "3" services: webserver: - image: tjipenk/webserver:${PHPVERSION} + build: + context: ./bin/${PHPVERSION} + container_name: "${COMPOSE_PROJECT_NAME}-${PHPVERSION}" restart: "always" ports: - "${HOST_MACHINE_UNSECURE_HOST_PORT}:80" + # - "${HOST_MACHINE_SECURE_HOST_PORT}:443" links: - database volumes: @@ -27,7 +30,8 @@ services: extra_hosts: - "host.docker.internal:host-gateway" database: - image: mariadb:lts + build: + context: "./bin/${DATABASE}" container_name: "${COMPOSE_PROJECT_NAME}-${DATABASE}" restart: "always" ports: @@ -43,7 +47,7 @@ services: MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} phpmyadmin: - image: phpmyadmin:fpm + image: phpmyadmin container_name: "${COMPOSE_PROJECT_NAME}-phpmyadmin" links: - database diff --git a/docker-compose.yml b/docker-compose.yml index 3fd8c5402e..42f064976e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,13 +2,10 @@ version: "3" services: webserver: - build: - context: ./bin/${PHPVERSION} - container_name: "${COMPOSE_PROJECT_NAME}-${PHPVERSION}" + image: tjipenk/webserver:${PHPVERSION} restart: "always" ports: - "${HOST_MACHINE_UNSECURE_HOST_PORT}:80" - # - "${HOST_MACHINE_SECURE_HOST_PORT}:443" links: - database volumes: @@ -30,8 +27,7 @@ services: extra_hosts: - "host.docker.internal:host-gateway" database: - build: - context: "./bin/${DATABASE}" + image: mariadb:lts container_name: "${COMPOSE_PROJECT_NAME}-${DATABASE}" restart: "always" ports: @@ -47,7 +43,7 @@ services: MYSQL_USER: ${MYSQL_USER} MYSQL_PASSWORD: ${MYSQL_PASSWORD} phpmyadmin: - image: phpmyadmin + image: phpmyadmin:fpm container_name: "${COMPOSE_PROJECT_NAME}-phpmyadmin" links: - database From f0ee938c3b2b3359e544285eb9df9a1b47c54532 Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Tue, 17 Sep 2024 09:41:38 +0700 Subject: [PATCH 20/27] postgress --- bin/php83/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/php83/Dockerfile b/bin/php83/Dockerfile index 9349afab1f..2911db27c8 100644 --- a/bin/php83/Dockerfile +++ b/bin/php83/Dockerfile @@ -79,6 +79,9 @@ RUN docker-php-ext-install pdo_mysql && \ docker-php-ext-install calendar && \ docker-php-ext-install exif +# postgress pdo + +RUN apt-get update && apt-get install -y libpq-dev && docker-php-ext-install pdo pdo_pgsql # Install Freetype RUN apt-get -y update && \ From 3d5d20c65508d90ba9803e198c03ac2fe576fa0e Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Thu, 23 Jan 2025 16:11:28 +0700 Subject: [PATCH 21/27] update version add phalcon --- .github/workflows/docker-publish.yml | 10 ++++ bin/phalcon73/Dockerfile | 71 ++++++++++++++++++++++++++++ bin/php81/Dockerfile | 2 +- 3 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 bin/phalcon73/Dockerfile diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 1c6a7b0d3b..0135c8b75b 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -136,3 +136,13 @@ jobs: push: true tags: tjipenk/webserver:php83 labels: ${{ steps.meta.outputs.labels }} + + + - name: Build php phalcon 7.3 + id: push_ver_phalcon73 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/phalcon73 + push: true + tags: tjipenk/webserver:phalcon73 + labels: ${{ steps.meta.outputs.labels }} diff --git a/bin/phalcon73/Dockerfile b/bin/phalcon73/Dockerfile new file mode 100644 index 0000000000..a04571a710 --- /dev/null +++ b/bin/phalcon73/Dockerfile @@ -0,0 +1,71 @@ +FROM php:7.3.33-apache + +# install composer +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer +ENV COMPOSER_ALLOW_SUPERUSER=1 + +# install nodejs and npm +RUN apt update && \ + apt install nodejs npm -y + +# install libpng-dev +RUN apt install libpng-dev -y + +# install libfreetype6-dev libjpeg62-turbo-dev +RUN apt install libfreetype6-dev libjpeg62-turbo-dev -y + +# install cron +RUN apt install vim -y + +# install zip unzip +RUN apt install zip unzip + +# install zip unzip +RUN apt install cron -y + +# libicu untuk ext-intl +RUN apt install libicu-dev -y + +# libicu untuk ext-intl +RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ +&& docker-php-ext-install gd + +# install extension +RUN docker-php-ext-install \ + mysqli \ + pdo_mysql \ + intl + +RUN mkdir /cphalcon + +RUN git clone https://github.com/phalcon/cphalcon /cphalcon \ + && cd /cphalcon/build \ + && git checkout origin/3.4.x \ + && ./install + +COPY ./docker/vhost/custom.conf /etc/apache2/sites-available/000-default.conf + +COPY ./docker/php /usr/local/etc/php/conf.d + +EXPOSE 80 + +COPY ./docker/crontab/crontab /etc/cron.d/cron-kehadiran + +RUN chmod 0644 /etc/cron.d/cron-kehadiran + +## Apply crond +RUN crontab /etc/cron.d/cron-kehadiran + +RUN touch /var/log/cron.log + +WORKDIR /var/www/html + +COPY ./ /var/www/html/ + +RUN apt install git -y + +RUN composer install + +RUN a2enmod rewrite headers proxy proxy_http + +CMD cron && /usr/sbin/apache2ctl -D FOREGROUND diff --git a/bin/php81/Dockerfile b/bin/php81/Dockerfile index 4b9ce0f0ab..b32f2a536c 100644 --- a/bin/php81/Dockerfile +++ b/bin/php81/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1.14-apache-buster +FROM php:8.1.33-apache-buster # Surpresses debconf complaints of trying to install apt packages interactively # https://github.com/moby/moby/issues/4032#issuecomment-192327844 From c7491c1096b0335e1549eeaccbfeac4b8202f63f Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Thu, 23 Jan 2025 16:49:46 +0700 Subject: [PATCH 22/27] 8.1.31 --- bin/php81/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/php81/Dockerfile b/bin/php81/Dockerfile index b32f2a536c..c79f4b9c72 100644 --- a/bin/php81/Dockerfile +++ b/bin/php81/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1.33-apache-buster +FROM php:8.1.31-apache-buster # Surpresses debconf complaints of trying to install apt packages interactively # https://github.com/moby/moby/issues/4032#issuecomment-192327844 From 70d2d39fa87f652ab696bbf9dd8f6dc7ceceae08 Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Thu, 23 Jan 2025 18:58:17 +0700 Subject: [PATCH 23/27] 8.1.20 --- bin/php81/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/php81/Dockerfile b/bin/php81/Dockerfile index c79f4b9c72..4f5b9dad44 100644 --- a/bin/php81/Dockerfile +++ b/bin/php81/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.1.31-apache-buster +FROM php:8.1.20-apache-buster # Surpresses debconf complaints of trying to install apt packages interactively # https://github.com/moby/moby/issues/4032#issuecomment-192327844 From a7eda665b5bba99e9665703f265068a66d30de06 Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Fri, 24 Jan 2025 11:06:10 +0700 Subject: [PATCH 24/27] fix --- .github/workflows/docker-publish.yml | 53 +++++++++++++++++++++++----- bin/phalcon73/Dockerfile | 16 ++------- 2 files changed, 47 insertions(+), 22 deletions(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 0135c8b75b..f0b90507cd 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -14,6 +14,51 @@ on: branchs: master jobs: + + + push_to_registries_phalcon: + name: Push Docker image to multiple registries + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + attestations: write + id-token: write + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: | + tjipenk/webserver + ghcr.io/${{ github.repository }} + + - name: Build php phalcon 7.3 + id: push_ver_phalcon73 + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/phalcon73 + push: true + tags: tjipenk/webserver:phalcon73 + labels: ${{ steps.meta.outputs.labels }} + + push_to_registries: name: Push Docker image to multiple registries runs-on: ubuntu-latest @@ -138,11 +183,3 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - - name: Build php phalcon 7.3 - id: push_ver_phalcon73 - uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 - with: - context: ./bin/phalcon73 - push: true - tags: tjipenk/webserver:phalcon73 - labels: ${{ steps.meta.outputs.labels }} diff --git a/bin/phalcon73/Dockerfile b/bin/phalcon73/Dockerfile index a04571a710..4d1aae786c 100644 --- a/bin/phalcon73/Dockerfile +++ b/bin/phalcon73/Dockerfile @@ -43,21 +43,8 @@ RUN git clone https://github.com/phalcon/cphalcon /cphalcon \ && git checkout origin/3.4.x \ && ./install -COPY ./docker/vhost/custom.conf /etc/apache2/sites-available/000-default.conf - -COPY ./docker/php /usr/local/etc/php/conf.d - EXPOSE 80 -COPY ./docker/crontab/crontab /etc/cron.d/cron-kehadiran - -RUN chmod 0644 /etc/cron.d/cron-kehadiran - -## Apply crond -RUN crontab /etc/cron.d/cron-kehadiran - -RUN touch /var/log/cron.log - WORKDIR /var/www/html COPY ./ /var/www/html/ @@ -68,4 +55,5 @@ RUN composer install RUN a2enmod rewrite headers proxy proxy_http -CMD cron && /usr/sbin/apache2ctl -D FOREGROUND +# CMD cron && /usr/sbin/apache2ctl -D FOREGROUND +CMD /usr/sbin/apache2ctl -D FOREGROUND From c6632aff0b14399884208e69866a331b1541a279 Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Thu, 30 Jan 2025 10:18:51 +0700 Subject: [PATCH 25/27] del composer install --- bin/phalcon73/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/phalcon73/Dockerfile b/bin/phalcon73/Dockerfile index 4d1aae786c..f43c6cb0a9 100644 --- a/bin/phalcon73/Dockerfile +++ b/bin/phalcon73/Dockerfile @@ -51,7 +51,7 @@ COPY ./ /var/www/html/ RUN apt install git -y -RUN composer install +# RUN composer install RUN a2enmod rewrite headers proxy proxy_http From a07ff6ace03d47fadb5868b86571c4bdda014b14 Mon Sep 17 00:00:00 2001 From: alvin fatikhunnada Date: Tue, 25 Feb 2025 08:20:05 +0700 Subject: [PATCH 26/27] update user --- .github/workflows/docker-publish.yml | 68 +++++++++++++++++++++++++++- docker-compose.yml | 2 + 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index f0b90507cd..058f6eedd6 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -59,7 +59,7 @@ jobs: labels: ${{ steps.meta.outputs.labels }} - push_to_registries: + push_to_registries_php5: name: Push Docker image to multiple registries runs-on: ubuntu-latest permissions: @@ -110,6 +110,39 @@ jobs: tags: tjipenk/webserver:php56 labels: ${{ steps.meta.outputs.labels }} + push_to_registries_php7: + name: Push Docker image to multiple registries + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + attestations: write + id-token: write + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: | + tjipenk/webserver + ghcr.io/${{ github.repository }} + - name: Build php 7.1 id: push_ver71 uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 @@ -146,6 +179,39 @@ jobs: tags: tjipenk/webserver:php74 labels: ${{ steps.meta.outputs.labels }} + push_to_registries_php8: + name: Push Docker image to multiple registries + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + attestations: write + id-token: write + steps: + - name: Check out the repo + uses: actions/checkout@v4 + + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: | + tjipenk/webserver + ghcr.io/${{ github.repository }} + - name: Build php 8.0 id: push_ver8 uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 diff --git a/docker-compose.yml b/docker-compose.yml index 42f064976e..80e06e6c1b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,6 +26,7 @@ services: XDEBUG_CONFIG: "client_host=host.docker.internal remote_port=${XDEBUG_PORT}" extra_hosts: - "host.docker.internal:host-gateway" + user: www-data database: image: mariadb:lts container_name: "${COMPOSE_PROJECT_NAME}-${DATABASE}" @@ -71,6 +72,7 @@ services: - "127.0.0.1:${HOST_MACHINE_REDIS_PORT}:6379" crond: container_name: "${COMPOSE_PROJECT_NAME}-crond" + user: www-data build: context: ./bin/crond volumes: From bc4474dc4378b9b41b613237f56a09ac9cb6bbe0 Mon Sep 17 00:00:00 2001 From: alvin f Date: Tue, 25 Feb 2025 16:48:22 +0700 Subject: [PATCH 27/27] oci --- .github/workflows/docker-publish.yml | 18 ++++++- bin/php54-oci/Dockerfile | 77 ++++++++++++++++++++++++++++ bin/php56-oci/Dockerfile | 70 +++++++++++++++++++++++++ 3 files changed, 163 insertions(+), 2 deletions(-) create mode 100644 bin/php54-oci/Dockerfile create mode 100644 bin/php56-oci/Dockerfile diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 058f6eedd6..c3b7c18420 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -15,7 +15,6 @@ on: jobs: - push_to_registries_phalcon: name: Push Docker image to multiple registries runs-on: ubuntu-latest @@ -100,7 +99,14 @@ jobs: push: true tags: tjipenk/webserver:php54 labels: ${{ steps.meta.outputs.labels }} - + - name: Build php 5.4 oci + id: push_ver54oci + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php54-oci + push: true + tags: tjipenk/webserver:php54-oci + labels: ${{ steps.meta.outputs.labels }} - name: Build php 5.6 id: push_ver56 uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 @@ -109,6 +115,14 @@ jobs: push: true tags: tjipenk/webserver:php56 labels: ${{ steps.meta.outputs.labels }} + - name: Build php 5.6 oci + id: push_ver56oci + uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671 + with: + context: ./bin/php56-oci + push: true + tags: tjipenk/webserver:php56-oci + labels: ${{ steps.meta.outputs.labels }} push_to_registries_php7: name: Push Docker image to multiple registries diff --git a/bin/php54-oci/Dockerfile b/bin/php54-oci/Dockerfile new file mode 100644 index 0000000000..1f278bcb44 --- /dev/null +++ b/bin/php54-oci/Dockerfile @@ -0,0 +1,77 @@ +FROM php:5.4-apache + +# Backup and clean source.list file +RUN cp /etc/apt/sources.list /etc/apt/sources.list.old && \ + cat /dev/null > /etc/apt/sources.list + +# Fix the source.list for jessie +RUN printf "deb http://archive.debian.org/debian/ jessie main\n" > /etc/apt/sources.list && \ + printf "deb-src http://archive.debian.org/debian/ jessie main\n" >> /etc/apt/sources.list && \ + printf "deb http://archive.debian.org/debian-security jessie/updates main\n" >> /etc/apt/sources.list && \ + printf "deb-src http://archive.debian.org/debian-security jessie/updates main" >> /etc/apt/sources.list + +RUN apt-get -y --allow-unauthenticated update && apt-get upgrade -y --allow-unauthenticated + +# Install tools && libraries +RUN apt-get -y --allow-unauthenticated install --fix-missing apt-utils nano wget dialog \ + build-essential git curl libcurl3 libcurl3-dev zip \ + libmcrypt-dev libsqlite3-dev libsqlite3-0 mysql-client \ + zlib1g-dev libicu-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev \ + libapache2-mod-rpaf libpng12-dev \ + && rm -rf /var/lib/apt/lists/* + +# Composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +# Download oracle packages and install OCI8 +RUN curl -o instantclient-basic-linux.x64-19.6.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip \ + && unzip instantclient-basic-linux.x64-19.6.0.0.0dbru.zip -d /usr/lib/oracle/ \ + && rm instantclient-basic-linux.x64-19.6.0.0.0dbru.zip \ + && curl -o instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip \ + && unzip instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip -d /usr/lib/oracle/ \ + && rm instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip \ + && echo /usr/lib/oracle/instantclient_19_6 > /etc/ld.so.conf.d/oracle-instantclient.conf \ + && ldconfig + +ENV LD_LIBRARY_PATH=/usr/lib/oracle/instantclient_19_6 + +# PHP5 Extensions +RUN docker-php-ext-install curl \ + && docker-php-ext-install tokenizer \ + && docker-php-ext-install json \ + && docker-php-ext-install bcmath \ + && docker-php-ext-install mcrypt \ + && docker-php-ext-install pdo_mysql \ + && docker-php-ext-install pdo_sqlite \ + && docker-php-ext-install mysql \ + && docker-php-ext-install mysqli \ + && docker-php-ext-install zip \ + && docker-php-ext-install intl \ + && docker-php-ext-install mbstring + +RUN docker-php-ext-configure oci8 --with-oci8=instantclient,/usr/lib/oracle/instantclient_19_6 \ + && docker-php-ext-install oci8 + +RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install gd + +RUN pecl install xdebug-2.4.0RC4 && docker-php-ext-enable xdebug \ + && echo "xdebug.remote_enable=1" >> /usr/local/etc/php/php.ini + +RUN apt-get -y --allow-unauthenticated update && apt-get -y --allow-unauthenticated install libaio1 libaio-dev \ + && rm -rf /var/lib/apt/lists/* + +# Insure an SSL directory exists +RUN mkdir -p /etc/apache2/ssl + +# Enable SSL support +RUN a2enmod ssl && a2enmod rewrite + +# Enable apache modules +RUN a2enmod rewrite headers +RUN a2enmod rewrite rpaf + +EXPOSE 80 +EXPOSE 443 + +# ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] diff --git a/bin/php56-oci/Dockerfile b/bin/php56-oci/Dockerfile new file mode 100644 index 0000000000..6121e33a94 --- /dev/null +++ b/bin/php56-oci/Dockerfile @@ -0,0 +1,70 @@ +FROM php:5.6-apache + +# Backup and clean source.list file +RUN cp /etc/apt/sources.list /etc/apt/sources.list.old && \ + cat /dev/null > /etc/apt/sources.list + +# Fix the source.list for stretch +RUN printf "deb http://archive.debian.org/debian/ stretch main\n" > /etc/apt/sources.list && \ + printf "deb-src http://archive.debian.org/debian/ stretch main\n" >> /etc/apt/sources.list && \ + printf "deb http://archive.debian.org/debian-security stretch/updates main\n" >> /etc/apt/sources.list && \ + printf "deb-src http://archive.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list + +RUN apt-get -y update && apt-get upgrade -y + +# Install tools && libraries +RUN apt-get -y install --fix-missing nano wget dialog \ + build-essential git curl libcurl3 libcurl3-dev zip \ + libmcrypt-dev libsqlite3-dev libsqlite3-0 mysql-client \ + zlib1g-dev libicu-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev \ + libaio1 libaio-dev \ + && rm -rf /var/lib/apt/lists/* + +# Composer +RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer + +# Download oracle packages and install OCI8 +RUN curl -o instantclient-basic-linux.x64-19.6.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip \ + && unzip instantclient-basic-linux.x64-19.6.0.0.0dbru.zip -d /usr/lib/oracle/ \ + && rm instantclient-basic-linux.x64-19.6.0.0.0dbru.zip \ + && curl -o instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip \ + && unzip instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip -d /usr/lib/oracle/ \ + && rm instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip \ + && echo /usr/lib/oracle/instantclient_19_6 > /etc/ld.so.conf.d/oracle-instantclient.conf \ + && ldconfig + +ENV LD_LIBRARY_PATH=/usr/lib/oracle/instantclient_19_6 + +# PHP5 Extensions +RUN docker-php-ext-install curl \ + && docker-php-ext-install tokenizer \ + && docker-php-ext-install json \ + && docker-php-ext-install bcmath \ + && docker-php-ext-install mcrypt \ + && docker-php-ext-install pdo_mysql \ + && docker-php-ext-install pdo_sqlite \ + && docker-php-ext-install mysqli \ + && docker-php-ext-install zip \ + && docker-php-ext-install -j$(nproc) intl \ + && docker-php-ext-install mbstring \ + && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \ + && docker-php-ext-install -j$(nproc) gd \ + && pecl install xdebug-2.5.5 && docker-php-ext-enable xdebug \ + && echo "xdebug.remote_enable=1" >> /usr/local/etc/php/php.ini + +RUN docker-php-ext-configure oci8 --with-oci8=instantclient,/usr/lib/oracle/instantclient_19_6 \ + && docker-php-ext-install oci8 + +# Insure an SSL directory exists +RUN mkdir -p /etc/apache2/ssl + +# Enable SSL support +RUN a2enmod ssl && a2enmod rewrite + +# Enable apache modules +RUN a2enmod rewrite headers + +EXPOSE 80 +EXPOSE 443 + +ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]