From 75193a29e0f8a19ff9d6388f6c57f4c7168605ef Mon Sep 17 00:00:00 2001 From: MagnusPienknyJTL Date: Wed, 10 Jun 2026 10:43:54 +0200 Subject: [PATCH 1/2] Fixed --- .env.sample | 13 +++++++++---- README.md | 32 ++++++++++++++++++++++++++++++++ data/php/php.ini | 2 +- docker-compose.override.yml | 4 ++++ docker-compose.yml | 16 ++++++++++++++-- dockerfiles/fpm.dockerfile | 13 +++++++++++++ 6 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 docker-compose.override.yml diff --git a/.env.sample b/.env.sample index d01d33c..09d3cf7 100644 --- a/.env.sample +++ b/.env.sample @@ -1,10 +1,10 @@ ## php version -PHP_VERSION=8.4 +PHP_VERSION=8.5 #PHP_VERSION=8.1 #PHP_VERSION=8.0 ## php extensions (space separated) -PHP_EXTENSIONS=gd pdo_mysql bcmath soap intl zip imagick redis xdebug curl simplexml mbstring sqlite3 xml mysqli @composer +PHP_EXTENSIONS="gd pdo_mysql bcmath soap intl zip imagick redis xdebug curl simplexml mbstring sqlite3 xml mysqli @composer" ## database credentials #MYSQL_DATABASE=database @@ -12,16 +12,21 @@ MYSQL_USER= MYSQL_PASSWORD= MYSQL_ROOT_PASSWORD= +MSSQL_PASSWORD="sa04JTLsa04JTL!" + ## bash extensions (space separated) -BASH_EXTENSIONS=git default-mysql-client openssh-client wget curl nano unzip +BASH_EXTENSIONS="bash git default-mysql-client openssh-client wget curl nano unzip" ## node version (node for latest version, else use xx.xx.x) NODE_VERSION= ## apache modules (space separated) -APACHE_EXTENSIONS=vhost_alias rewrite proxy_fcgi +APACHE_EXTENSIONS="vhost_alias rewrite proxy_fcgi" ## local Name, User ID and Group ID (GID/UID should usually be 1000) USERNAME= UID= GID= + +WORKDIR=../../Public/ + diff --git a/README.md b/README.md index b7fe771..15bf766 100644 --- a/README.md +++ b/README.md @@ -68,3 +68,35 @@ Required Modules: vhost_alias rewrite proxy_fcgi 10. **MariaDB Database** can be accessed with external database management tool like **dbeaver** and alike using **localhost:3306** as host. Databases will be persisted in **./databases** folder. 11. To access the **bash cli** run the following command to start a cli container which closes itself after exiting: `docker compose run --rm cli` + +## Shell Aliases +To make working with the container easier, you can register a set of aliases that wrap the most common `docker compose` commands so you can run them from any directory. + +To avoid hardcoding the path, run the following snippet **from the repository root** (the directory containing `docker-compose.yml`). It captures the current path with `$(pwd)` and writes the aliases with the absolute path baked in into your `~/.zshrc` (use `~/.bashrc` for bash): + +```bash +DEV_CONTAINER_PATH="$(pwd)" +cat >> ~/.zshrc <- **devup** +> Starts the dev container in detached mode. +>- **devdown** +> Stops and removes the dev container. +>- **devrestart** +> Stops the container and starts it again in detached mode. +>- **devlogs** +> Shows the logs of the dev container. diff --git a/data/php/php.ini b/data/php/php.ini index 56718f8..231c7ba 100644 --- a/data/php/php.ini +++ b/data/php/php.ini @@ -695,7 +695,7 @@ auto_globals_jit = On ; Its value may be 0 to disable the limit. It is ignored if POST data reading ; is disabled through enable_post_data_reading. ; https://php.net/post-max-size -post_max_size = 8M +post_max_size = 256M ; Automatically add files before PHP document. ; https://php.net/auto-prepend-file diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 0000000..f20b958 --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,4 @@ +services: + wawidb: + platform: linux/amd64 + \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c64dc83..3478a4e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,7 +19,7 @@ services: stop_grace_period: 0.3s networks: default: - aliases: + #aliases: # enter urls that should be available via curl in the web container here, e.g.: # - myapp.test php-8.0: @@ -30,8 +30,10 @@ services: dockerfile: fpm.dockerfile args: - PHP_EXTENSIONS=${PHP_EXTENSIONS} + - BASH_EXTENSIONS=${BASH_EXTENSIONS} - PHP_VERSION=8.0 - USERNAME=${USERNAME} + - NODE_VERSION=${NODE_VERSION} user: ${UID}:${GID} volumes: - ${WORKDIR}:/var/www/html/ @@ -47,8 +49,10 @@ services: dockerfile: fpm.dockerfile args: - PHP_EXTENSIONS=${PHP_EXTENSIONS} + - BASH_EXTENSIONS=${BASH_EXTENSIONS} - PHP_VERSION=8.1 - USERNAME=${USERNAME} + - NODE_VERSION=${NODE_VERSION} user: ${UID}:${GID} volumes: - ${WORKDIR}:/var/www/html/ @@ -64,8 +68,10 @@ services: dockerfile: fpm.dockerfile args: - PHP_EXTENSIONS=${PHP_EXTENSIONS} + - BASH_EXTENSIONS=${BASH_EXTENSIONS} - PHP_VERSION=8.2 - USERNAME=${USERNAME} + - NODE_VERSION=${NODE_VERSION} user: ${UID}:${GID} volumes: - ${WORKDIR}:/var/www/html/ @@ -81,8 +87,10 @@ services: dockerfile: fpm.dockerfile args: - PHP_EXTENSIONS=${PHP_EXTENSIONS} + - BASH_EXTENSIONS=${BASH_EXTENSIONS} - PHP_VERSION=8.3 - USERNAME=${USERNAME} + - NODE_VERSION=${NODE_VERSION} user: ${UID}:${GID} volumes: - ${WORKDIR}:/var/www/html/ @@ -98,8 +106,10 @@ services: dockerfile: fpm.dockerfile args: - PHP_EXTENSIONS=${PHP_EXTENSIONS} + - BASH_EXTENSIONS=${BASH_EXTENSIONS} - PHP_VERSION=8.4 - USERNAME=${USERNAME} + - NODE_VERSION=${NODE_VERSION} user: ${UID}:${GID} volumes: - ${WORKDIR}:/var/www/html/ @@ -115,8 +125,10 @@ services: dockerfile: fpm.dockerfile args: - PHP_EXTENSIONS=${PHP_EXTENSIONS} + - BASH_EXTENSIONS=${BASH_EXTENSIONS} - PHP_VERSION=8.5 - USERNAME=${USERNAME} + - NODE_VERSION=${NODE_VERSION} user: ${UID}:${GID} volumes: - ${WORKDIR}:/var/www/html/ @@ -141,7 +153,7 @@ services: container_name: mssql environment: - ACCEPT_EULA=Y - - MSSQL_SA_PASSWORD= + - MSSQL_SA_PASSWORD=${MSSQL_PASSWORD} - MSSQL_OID=Express - MSSQL_COLLATION=Latin1_General_CI_AS ports: diff --git a/dockerfiles/fpm.dockerfile b/dockerfiles/fpm.dockerfile index 6a4d58a..24e45d1 100644 --- a/dockerfiles/fpm.dockerfile +++ b/dockerfiles/fpm.dockerfile @@ -1,12 +1,19 @@ ARG PHP_VERSION=${PHP_VERSION} +ARG NODE_VERSION=${NODE_VERSION:24} ########################################################################################################## +FROM node:${NODE_VERSION}-alpine AS node + FROM php:${PHP_VERSION}-fpm-alpine #update/upgrade packages RUN apk update && apk upgrade +#install desired bash extensions +ARG BASH_EXTENSIONS=${BASH_EXTENSIONS} +RUN apk add ${BASH_EXTENSIONS} + #include php extension installer script because image provided method sucks balls ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod +x /usr/local/bin/install-php-extensions @@ -15,4 +22,10 @@ RUN chmod +x /usr/local/bin/install-php-extensions ARG PHP_EXTENSIONS=${PHP_EXTENSIONS} RUN install-php-extensions ${PHP_EXTENSIONS} +#copy node files from other image +COPY --from=node /usr/local/bin/node /usr/local/bin/node +COPY --from=node /usr/local/bin/npm /usr/local/bin/npm +COPY --from=node /usr/local/bin/npx /usr/local/bin/npx +COPY --from=node /usr/local/lib/node_modules /usr/local/lib/node_modules + ########################################################################################################## \ No newline at end of file From cd6fbd60a7a4ee3cc7b8c0e6995603b7afe2c15d Mon Sep 17 00:00:00 2001 From: akempe Date: Thu, 11 Jun 2026 10:20:22 +0200 Subject: [PATCH 2/2] localhost changed to test, also make phpversion hints more prominent --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 15bf766..1558b87 100644 --- a/README.md +++ b/README.md @@ -51,13 +51,13 @@ Required Modules: vhost_alias rewrite proxy_fcgi 2. Use `docker compose --build` this will start pulling and building the images. This process will take a lot of time so be patient. If the **PHP_VERSION** is changed in the **.env** file the build process for the cli container needs to be repeated. This step is only needed once for every **PHP_VERSION** if you need them. -3. If you need to switch the server php-fpm version, create an empty file in your project root with one of the following names: 80.phpversion / 81.phpversion / 82.phpversion no restart required. +3. If you need to switch the server php-fpm version, create an empty file in your project root with one of the following names: **80.phpversion** / **81.phpversion** / **82.phpversion** no restart required. 4. Once the images are built, the container can be started with `docker compose up -d`. -5. All your projects will be reachable via wildcard domain, the pattern is **foldername.localhost** to reach the **root** of your project or **foldername.public.localhost** to reach the **public** folder of your project, if you wish to change the domain ending it has to be changed in **./data/apache/wildcard.conf** on line 2 +5. All your projects will be reachable via wildcard domain, the pattern is **foldername.test** to reach the **root** of your project or **foldername.public.test** to reach the **public** folder of your project, if you wish to change the domain ending it has to be changed in **./data/apache/wildcard.conf**. -6. Domains ending in .localhost always loop back to 127.0.0.1 so there is no need for a dns service like dnsmasq. +6. Domains ending in .test require a local DNS resolver like **dnsmasq** or manual entries in **/etc/hosts** (e.g. `127.0.0.1 foldername.test`) to resolve to 127.0.0.1. 7. **.ssh** and **.gitconfig** for the **cli** image will be mounted from the host home directory to the container user home directory as defined in the .env file. So the files need to be created and stored on the host first.