Skip to content

Commit

Permalink
Prepare 4.4.0
Browse files Browse the repository at this point in the history
-   Add PHP 8.4 (without Xdebug as this is not available yet)
-   Add Xdebug to PHP 8.3 Workspace as it's now supported
-   Make PHPMyAdmin and phpRedisAdmin optional through profiles to save system resources for those who do not use it
  • Loading branch information
johanvanhelden committed Nov 28, 2024
1 parent 856baf8 commit bcbe923
Show file tree
Hide file tree
Showing 16 changed files with 511 additions and 26 deletions.
10 changes: 8 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

## 4.4.0 - 2024-11-28

- Add PHP 8.4 (without Xdebug as this is not available yet)
- Add Xdebug to PHP 8.3 Workspace as it's now supported
- Make PHPMyAdmin and phpRedisAdmin optional through profiles to save system resources for those who do not use it

## 4.3.1 - 2024-10-04

- Add Makefile with several commands for a cleaner experience.
Expand All @@ -18,7 +24,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## 4.1.0 - 2023-11-30

- Add PHP 8.3 (without xdebug in the workspace as this is not available yet)
- Add PHP 8.3 (without Xdebug in the workspace as this is not available yet)
- [Workspace] Changed `phusion/baseimage` to the `focal` tag

## 4.0.0 - 2023-09-18
Expand Down Expand Up @@ -407,7 +413,7 @@ services:

- Add the dns option to the workspace image to fix dns issues on OSX
- Add a better update section to the readme
- Increased xdebug dumping depth to show everything when dumping data. (php-5.6-fpm image)
- Increased Xdebug dumping depth to show everything when dumping data. (php-5.6-fpm image)
- Ensure all e-mail is caught by Mailhog by default and update the readme to reflect this change. (php-5.6-fpm image)

## 1.0.2 - 2016-11-21
Expand Down
40 changes: 22 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ services:

php:
container_name: dockerhero_php
build: ./php/8.2
build: ./php/8.3
restart: unless-stopped
links:
- db
Expand Down Expand Up @@ -112,6 +112,23 @@ services:
healthcheck:
test: ["CMD", "redis-cli", "ping"]

minio:
container_name: dockerhero_minio
image: minio/minio:latest
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_USER=root
- MINIO_ROOT_PASSWORD=dockerhero
ports:
- "9001:9001"
- "9000:9000"
networks:
dockerhero:
ipv4_address: 172.25.0.18
volumes:
- ./minio:/data

phpmyadmin:
container_name: dockerhero_dbadmin
image: phpmyadmin
Expand Down Expand Up @@ -139,6 +156,8 @@ services:
networks:
dockerhero:
ipv4_address: 172.25.0.16
profiles:
- phpmyadmin

phpredisadmin:
container_name: dockerhero_redisadmin
Expand All @@ -156,23 +175,8 @@ services:
networks:
dockerhero:
ipv4_address: 172.25.0.17

minio:
container_name: dockerhero_minio
image: minio/minio:latest
restart: unless-stopped
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_USER=root
- MINIO_ROOT_PASSWORD=dockerhero
ports:
- "9001:9001"
- "9000:9000"
networks:
dockerhero:
ipv4_address: 172.25.0.18
volumes:
- ./minio:/data
profiles:
- phpredisadmin

networks:
dockerhero:
Expand Down
80 changes: 80 additions & 0 deletions php/8.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
FROM php:8.4-fpm

LABEL maintainer="Johan van Helden <[email protected]>"

ARG TZ=UTC
ENV TZ ${TZ}

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/

# Install dependencies
RUN apt-get update && apt-get install -y \
mariadb-client \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
libcurl4-nss-dev \
libc-client-dev \
libkrb5-dev \
firebird-dev \
libicu-dev \
libxml2-dev \
libxslt1-dev \
autoconf \
wget \
zip \
unzip \
cron \
git \
libzip-dev \
locales-all \
libonig-dev \
wkhtmltopdf

RUN install-php-extensions \
bcmath \
exif \
gd \
imagick \
imap \
intl \
mysqli \
pdo_mysql \
redis \
soap \
ssh2 \
# xdebug \
xmlrpc \
xsl \
zip

# Set the timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Comment out xdebug extension line per default
# RUN sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

# Copy xdebug configuration for remote debugging
# COPY ./includes/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini

# Copy the php-fpm config
COPY ./includes/dockerhero.fpm.conf /usr/local/etc/php-fpm.d/zzz-dockerhero.fpm.conf
COPY ./includes/dockerhero.php.ini /usr/local/etc/php/conf.d/dockerhero.php.ini

# Setup mhsendmail
COPY ./includes/mhsendmail_linux_amd64 /usr/local/bin/mhsendmail
RUN chmod +x /usr/local/bin/mhsendmail

# Cleanup all downloaded packages
RUN apt-get -y autoclean && apt-get -y autoremove && apt-get -y clean && rm -rf /var/lib/apt/lists/* && apt-get update

# Set the proper permissions
RUN usermod -u 1000 www-data

# Add the startup script and set executable
COPY ./includes/.startup.sh /var/scripts/.startup.sh
RUN chmod +x /var/scripts/.startup.sh

# Run the startup script
CMD ["/var/scripts/.startup.sh"]
62 changes: 62 additions & 0 deletions php/8.4/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# dockerhero-php-8.4-fpm

https://github.com/johanvanhelden/dockerhero

## Testing the image locally

```
$ docker-compose up --build
$ docker exec -it dockerhero-php-8.4-fpm-testing bash
```

## Enabled PHP modules

```
bcmath
Core
ctype
curl
date
dom
exif
fileinfo
filter
gd
hash
iconv
imagick
imap
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
random
readline
redis
Reflection
session
SimpleXML
soap
sodium
SPL
sqlite3
ssh2
standard
tokenizer
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
```
8 changes: 8 additions & 0 deletions php/8.4/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
services:
workspace:
container_name: dockerhero-php-8.4-fpm-testing
build: .
volumes:
- ./../:/var/www/projects
tty: true
dns: 8.8.8.8
10 changes: 10 additions & 0 deletions php/8.4/includes/.startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

# Inserts the fresh user cronjobs into crontab
crontab /var/crons/crons

# start cron in the background
cron -f &

# php-fpm must be started in the foreground
php-fpm
10 changes: 10 additions & 0 deletions php/8.4/includes/dockerhero.fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
catch_workers_output = yes

php_value[date.timezone] = UTC
php_value[error_reporting] = E_ALL & ~E_STRICT

php_admin_value[error_log] = /var/log/php/fpm-php.www.log
php_admin_value[sendmail_path] = "/usr/local/bin/mhsendmail --smtp-addr=dockerhero_mail:1025"
php_admin_flag[display_startup_errors] = on
php_flag[display_errors] = On
php_admin_flag[log_errors] = On
2 changes: 2 additions & 0 deletions php/8.4/includes/dockerhero.php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
date.timezone = "UTC"
sendmail_path = "/usr/local/bin/mhsendmail --smtp-addr=dockerhero_mail:1025"
Binary file added php/8.4/includes/mhsendmail_linux_amd64
Binary file not shown.
12 changes: 12 additions & 0 deletions php/8.4/includes/xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)

xdebug.mode=debug,profile,develop,coverage,trace
xdebug.start_with_request=yes

xdebug.discover_client_host=1
xdebug.client_port=9005

xdebug.cli_color=0
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
21 changes: 17 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Dockerhero

## Version 4.3.1
## Version 4.4.0

### What is Dockerhero?

Expand All @@ -16,7 +16,7 @@ Dockerhero includes the following software (containers):
- NGINX (latest)
- mySQL (5.7)
- Redis (latest)
- PHP (8.2-fpm by default, [or choose a different version](#picking-a-php-version))
- PHP (8.3-fpm by default, [or choose a different version](#picking-a-php-version))
- Mailpit
- phpMyAdmin
- phpRedisAdmin
Expand Down Expand Up @@ -116,15 +116,17 @@ services:
# build: ./php/8.1
# build: ./php/8.2
# build: ./php/8.3
# build: ./php/8.4

workspace:
build: ./workspace/php8.0
# build: ./workspace/php8.1
# build: ./workspace/php8.2
# build: ./workspace/php8.3
# build: ./workspace/php8.4
```

Available versions are: `8.3`, `8.2`, `8.1` and `8.0`.
Available versions are: `8.4`, `8.3`, `8.2`, `8.1` and `8.0`.

If you would like to use an even older PHP version, you can use one of the old images:
`image: johanvanhelden/dockerhero-php-[VERSION_NUMBER]-fpm:latest`
Expand Down Expand Up @@ -246,12 +248,17 @@ You will now be able to install and update private packages inside Dockerhero.
### MySQL
Via phpMyAdmin you can create new databases and users. The database host you would need to use in your projects would be:
The database host you would need to use in your projects would be:
```
mySQL host: dockerhero_db
mySQL port: 3306
```
#### GUI
You can use any GUI you prefer. For example [DBeaver](https://dbeaver.io/).
If you would prefer not to install any tools, you can also use the PHPMyAdmin tool that is bundled with Dockerhero.
Make sure to start dockerhero with the `--profile phpmyadmin` flag to ensure PHPMyAdmin starts (`docker compose --profile phpmyadmin up`).

You can visit phpMyAdmin by going to `http://localhost:8026/`

Expand Down Expand Up @@ -315,6 +322,12 @@ Redis host: dockerhero_redis
Redis port: 6379
```

#### GUI
You can use any GUI you prefer. For example [Another Redis Desktop Manager](https://goanother.com/).

If you would prefer not to install any tools, you can also use the phpRedisAdmin tool that is bundled with Dockerhero.
Make sure to start dockerhero with the `--profile phpredisadmin` flag to ensure PHPMyAdmin starts (`docker compose --profile phpredisadmin up`).

You can visit phpRedisAdmin by going to `http://localhost:8027`

#### Using Redis with Laravel
Expand Down
4 changes: 2 additions & 2 deletions workspace/php8.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ RUN apt-get update && \
php8.3-memcached \
php8.3-gd \
php8.3-redis \
# php8.3-xdebug \
php8.3-xdebug \
php8.3-dev \
php8.3-imagick \
php-pear \
Expand Down Expand Up @@ -84,7 +84,7 @@ RUN update-alternatives --set php /usr/bin/php8.3 && \
update-alternatives --set phar.phar /usr/bin/phar.phar8.3

# Disable Xdebug per default
# RUN sed -i 's/^zend_extension=/;zend_extension=/g' /etc/php/8.3/cli/conf.d/20-xdebug.ini
RUN sed -i 's/^zend_extension=/;zend_extension=/g' /etc/php/8.3/cli/conf.d/20-xdebug.ini

#Install chrome - needed for Laravel Dusk
RUN curl -sS https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
Expand Down
Loading

0 comments on commit bcbe923

Please sign in to comment.