From 562fd13a4931184b907e349b5bfd2591392674f8 Mon Sep 17 00:00:00 2001 From: "alvin.f" Date: Sat, 14 Jan 2023 12:47:13 +0700 Subject: [PATCH 01/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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/12] 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