Skip to content

added phpmyadmin and php8.2 services, update mysql from 5.7 to 8 #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
run:
docker-compose up -d --build nginx mysql5.7 php8.0 php7.4 php7.3
docker-compose up -d --build nginx pma mysql8 php8.2 php8.0 php7.4 php7.3

cli-7.3: run
docker exec -it php7.3 bash
Expand All @@ -9,3 +9,6 @@ cli-7.4: run

cli-8.0: run
docker exec -it php8.0 bash

cli-8.2: run
docker exec -it php8.2 bash
14 changes: 8 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ English manual

Docker-based development environment:

* PHP versions: 8.0, 7.4 and 7.3.
* MySQL 5.7 database server.
* PHP versions: 8.2, 8.0, 7.4 and 7.3.
* MySQL 8 database server.
* nginx web server.

------------
Expand Down Expand Up @@ -50,7 +50,7 @@ Installation
MySQL connection
----------------

* DB host: mysql5.7.
* DB host: mysql8.
* User: root.
* Password: root.

Expand All @@ -66,6 +66,7 @@ To use the specific PHP version for your requests, add the following prefix to t
* ``php7.3.`` for PHP 7.3.
* ``php7.4.`` for PHP 7.4.
* ``php8.0.`` for PHP 8.0.
* ``php8.2.`` for PHP 8.2.

---------------
Sending e-mails
Expand Down Expand Up @@ -114,8 +115,8 @@ Uncomment the lines in docker-compose.yml and run the following commands:

Среда для разработки на базе Docker:

* Версии PHP: 8.0, 7.4 и 7.3.
* Сервер баз данных MySQL 5.7.
* Версии PHP: 8.2, 8.0, 7.4 и 7.3.
* Сервер баз данных MySQL 8.
* Веб-сервер nginx.

---------
Expand Down Expand Up @@ -153,7 +154,7 @@ Uncomment the lines in docker-compose.yml and run the following commands:
Подключение к MySQL
-------------------

* Хост БД: mysql5.7.
* Хост БД: mysql8.
* Пользователь: root.
* Пароль: root.

Expand All @@ -168,6 +169,7 @@ Uncomment the lines in docker-compose.yml and run the following commands:
* ``php7.3.`` для PHP 7.3.
* ``php7.4.`` для PHP 7.4.
* ``php8.0.`` для PHP 8.0.
* ``php8.2.`` для PHP 8.2

------------------
Отправка e-mail'ов
Expand Down
1 change: 1 addition & 0 deletions config/nginx/app.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ map $http_host $fastcgi_backend {
~^php7.3. php7.3:9000;
~^php7.4. php7.4:9000;
~^php8.0. php8.0:9000;
~^php8.2. php8.2:9000;
}

server {
Expand Down
10 changes: 6 additions & 4 deletions config/php7.4/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,18 @@ RUN set -xe; \
git \
zip unzip \
curl \
libzip-dev libcurl4-gnutls-dev libpng-dev libxml2-dev libjpeg-dev libfreetype6-dev \
libmagickwand-dev; \
libzip-dev libcurl4-gnutls-dev libpng-dev libxml2-dev libjpeg-dev libfreetype6-dev; \
curl -sL https://deb.nodesource.com/setup_12.x | bash -; \
apt install -y nodejs; \
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/; \
docker-php-ext-install pdo_mysql mysqli gd json zip intl soap mbstring exif bcmath curl sockets; \
pecl install imagick; \
docker-php-ext-enable imagick; \
docker-php-ext-enable mysqli;

RUN apt-get update; \
apt-get install -y libmagickwand-dev; \
pecl install imagick; \
docker-php-ext-enable imagick;

# RUN set -xe ; \
# pecl install xdebug-3.1.6; \
# docker-php-ext-enable xdebug
42 changes: 42 additions & 0 deletions config/php8.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM php:8.2.8-fpm

ENV VERSION_ONIG=6.9.3
ENV ONIG_BUILD_DIR=/tmp/oniguruma

RUN set -xe; \
mkdir -p ${ONIG_BUILD_DIR}; \
curl -Ls https://github.com/kkos/oniguruma/releases/download/v${VERSION_ONIG}/onig-${VERSION_ONIG}.tar.gz \
| tar xzC ${ONIG_BUILD_DIR} --strip-components=1; \
cd ${ONIG_BUILD_DIR}/; \
./configure; \
make -j $(nproc); \
make install


RUN set -xe; \
mkdir -p /usr/src/php/ext/imagick; \
curl -fsSL https://github.com/Imagick/imagick/archive/refs/tags/3.7.0.tar.gz \
| tar xvz -C "/usr/src/php/ext/imagick" --strip-components=1;



RUN set -xe; \
apt update; \
apt install --yes \
mariadb-client \
git \
zip unzip \
curl \
libzip-dev libcurl4-gnutls-dev libpng-dev libxml2-dev libjpeg-dev libfreetype6-dev \
libmagickwand-dev; \
curl -sL https://deb.nodesource.com/setup_12.x | bash -; \
apt install -y nodejs; \
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/; \
docker-php-ext-install pdo_mysql mysqli gd zip intl soap mbstring exif bcmath curl sockets; \
docker-php-ext-install imagick; \
docker-php-ext-enable imagick; \
docker-php-ext-enable mysqli;

# RUN set -xe ; \
# pecl install xdebug; \
# docker-php-ext-enable xdebug
7 changes: 7 additions & 0 deletions config/php8.2/php-ini-overrides.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
upload_max_filesize = 100M
post_max_size = 108M
max_execution_time = 3600
sendmail_path = "/usr/local/bin/sendmail --logdir=/app/log/sendmail/ "
xdebug.mode=debug
xdebug.client_host=host.docker.internal
xdebug.start_with_request=yes
33 changes: 30 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
version: "3.1"

services:

mysql5.7:
image: mysql:5.7
container_name: mysql5.7
pma:
image: phpmyadmin
restart: always
ports:
- 8080:80
environment:
- UPLOAD_LIMIT=2024M
- MAX_EXECUTION_TIME=6000
- PMA_ARBITRARY=1
- PMA_HOST=mysql8
depends_on:
- mysql8

mysql8:
image: mysql:8
container_name: mysql8
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
Expand Down Expand Up @@ -65,6 +79,19 @@ services:
environment:
PHP_IDE_CONFIG: serverName=localhost

php8.2:
build:
context: ./config/php8.2
dockerfile: Dockerfile
container_name: php8.2
working_dir: /app
volumes:
- ./app:/app
- ./config/php8.2/php-ini-overrides.ini:/usr/local/etc/php/conf.d/00-php.ini
- ./bin/sendmail:/usr/local/bin/sendmail
environment:
PHP_IDE_CONFIG: serverName=localhost

# Change default subnet addresses (for uncomment - delete only '#'):
#networks:
# default:
Expand Down