Skip to content

Commit 8b72adc

Browse files
samanthajayasingheDerschatta
authored andcommitted
Readd lost PHP 7.4 support
1 parent 6dc7feb commit 8b72adc

10 files changed

Lines changed: 126 additions & 2 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ php72 | 7.2 | [Dockerfile](https://github.com/totara/totara-docker-dev/blob/mas
2121
php72-debug | 7.2 + xdebug 2.7.1 | [Dockerfile](https://github.com/totara/totara-docker-dev/blob/master/php/php72-debug/Dockerfile) | [![Build status PHP 7.2 Debug](https://img.shields.io/docker/build/totara/docker-dev-php72-debug.svg)](https://hub.docker.com/r/totara/docker-dev-php72-debug/)
2222
php73 | 7.3 | [Dockerfile](https://github.com/totara/totara-docker-dev/blob/master/php/php73/Dockerfile) | [![Build status PHP 7.3](https://img.shields.io/docker/build/totara/docker-dev-php73.svg)](https://hub.docker.com/r/totara/docker-dev-php73/)
2323
php73-debug | 7.3 + xdebug 2.7.1 | [Dockerfile](https://github.com/totara/totara-docker-dev/blob/master/php/php73-debug/Dockerfile) | [![Build status PHP 7.3 Debug](https://img.shields.io/docker/build/totara/docker-dev-php73-debug.svg)](https://hub.docker.com/r/totara/docker-dev-php73-debug/)
24+
php74 | 7.4 | [Dockerfile](https://github.com/totara/totara-docker-dev/blob/master/php/php74/Dockerfile) | [![Build status PHP 7.4](https://img.shields.io/docker/build/totara/docker-dev-php74.svg)](https://hub.docker.com/r/totara/docker-dev-php74/)
25+
php74-debug | 7.4 + xdebug 2.7.1 | [Dockerfile](https://github.com/totara/totara-docker-dev/blob/master/php/php74-debug/Dockerfile) | [![Build status PHP 7.4 Debug](https://img.shields.io/docker/build/totara/docker-dev-php74-debug.svg)](https://hub.docker.com/r/totara/docker-dev-php74-debug/)
2426

2527
# A Docker setup for local Totara Learn development
2628

@@ -60,7 +62,7 @@ Please check out the [contribute](CONTRIBUTE.md) page for more information on ho
6062

6163
__Example:__
6264
```bash
63-
127.0.0.1 localhost totara54 totara54.debug totara54.behat totara55 totara55.debug totara55.behat totara55 totara55.debug totara56.behat totara70 totara70.debug totara70.behat totara71 totara71.debug totara71.behat totara72 totara72.debug totara72.behat totara73 totara73.debug totara73.behat
65+
127.0.0.1 localhost totara54 totara54.debug totara54.behat totara55 totara55.debug totara55.behat totara55 totara55.debug totara56.behat totara70 totara70.debug totara70.behat totara71 totara71.debug totara71.behat totara72 totara72.debug totara72.behat totara73 totara73.debug totara73.behat totara74 totara74.debug totara74.behat
6466
```
6567

6668
## Upgrade
@@ -473,4 +475,3 @@ You can customise the docker compose configurations simply adding your own `.yml
473475
## Custom bash aliases
474476

475477
The `bash` folder lets you add custom aliases and functions to your php containers. Any file with the `.bash` extension will be sourced into your php container whenever you bash into it. This is useful for when you need to run complex commands often during development, such as initialising tests. To get started, simply copy `aliases.bash.dist` to `aliases.bash` and define your aliases.
476-

compose/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,15 @@ services:
9393

9494
php-7.3-cron:
9595
build: ./php/php73-cron
96+
97+
php-7.4:
98+
build:
99+
context: ./php/php74
100+
args:
101+
TIME_ZONE: ${TIME_ZONE}
102+
103+
php-7.4-debug:
104+
build: ./php/php74-debug
105+
106+
php-7.4-cron:
107+
build: ./php/php74-cron

compose/php.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,5 +327,47 @@ services:
327327
networks:
328328
- totara
329329

330+
php-7.4:
331+
image: totara/docker-dev-php74
332+
container_name: totara_php74
333+
working_dir: ${REMOTE_SRC}
334+
environment:
335+
HIST_FILE: /root/.bash_history
336+
volumes:
337+
- ${LOCAL_SRC}:${REMOTE_SRC}
338+
- totara-data:${REMOTE_DATA}
339+
- $HOME/.bash_history:/root/.bash_history
340+
- ./bash:/root/custom_bash
341+
depends_on:
342+
- php-7.4-debug
343+
networks:
344+
- totara
345+
346+
php-7.4-debug:
347+
image: totara/docker-dev-php74-debug
348+
container_name: totara_php74_debug
349+
working_dir: ${REMOTE_SRC}
350+
environment:
351+
XDEBUG_CONFIG: remote_host=${HOST_IP}
352+
PHP_IDE_CONFIG: serverName=totara74
353+
HIST_FILE: /root/.bash_history
354+
volumes:
355+
- ${LOCAL_SRC}:${REMOTE_SRC}
356+
- totara-data:${REMOTE_DATA}
357+
- $HOME/.bash_history:/root/.bash_history
358+
- ./bash:/root/custom_bash
359+
networks:
360+
- totara
361+
362+
php-7.4-cron:
363+
image: totara/docker-dev-php74-cron
364+
container_name: totara_php74_cron
365+
volumes:
366+
- ${LOCAL_SRC}:${REMOTE_SRC}
367+
- totara-data:${REMOTE_DATA}
368+
- ./cron.d:/etc/cron.d
369+
networks:
370+
- totara
371+
330372
volumes:
331373
totara-data:

compose/sync.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ services:
9797
volumes:
9898
- totara-www-sync:${REMOTE_SRC}:nocopy
9999

100+
php-7.4:
101+
volumes:
102+
- totara-www-sync:${REMOTE_SRC}:nocopy
103+
104+
php-7.4-debug:
105+
volumes:
106+
- totara-www-sync:${REMOTE_SRC}:nocopy
107+
108+
php-7.4-cron:
109+
volumes:
110+
- totara-www-sync:${REMOTE_SRC}:nocopy
111+
100112
nodejs:
101113
volumes:
102114
- totara-www-sync:${REMOTE_SRC}:nocopy

nginx/config/totara.conf

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,21 @@ server {
130130
set $upstream php-7.3;
131131
include totara-server.conf;
132132
}
133+
134+
server {
135+
server_name totara74;
136+
set $upstream php-7.4;
137+
include totara-server.conf;
138+
}
139+
140+
server {
141+
server_name totara74.debug;
142+
set $upstream php-7.4-debug;
143+
include totara-server.conf;
144+
}
145+
146+
server {
147+
server_name totara74.behat;
148+
set $upstream php-7.4;
149+
include totara-server.conf;
150+
}

php/php74-cron/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM totara/docker-dev-php74:latest
2+
3+
RUN apt-get update && apt-get install -y cron
4+
5+
COPY entrypoint.sh /entrypoint.sh
6+
7+
RUN chmod +x /entrypoint.sh
8+
9+
CMD /entrypoint.sh

php/php74-cron/entrypoint.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
if [ -e /etc/cron.d/*.cron ]
4+
then
5+
# Install new crontab using all .cron files
6+
cat /etc/cron.d/*.cron | crontab - \
7+
&& crontab -l \
8+
&& cron -f
9+
else
10+
echo "No .cron files found in cron.d folder"
11+
fi

php/php74-debug/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM totara/docker-dev-php74:latest
2+
3+
RUN pecl install -f xdebug-2.8.0 && docker-php-ext-enable xdebug.so
4+
5+
RUN echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
6+
&& echo "xdebug.remote_autostart=0" >> /usr/local/etc/php/conf.d/xdebug.ini

php/php74/config/fpm.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[www]
2+
pm.max_children = 50

php/php74/config/php.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
log_errors = On
2+
error_log = /dev/stderr
3+
error_reporting = E_ALL & ~E_DEPRECATED
4+
max_input_vars = 2000
5+
date.timezone = Pacific/Auckland
6+
memory_limit=256M
7+
opcache.optimization_level=0x7FFFBBFF
8+
; necessary as Xdebug impacts performance that hard
9+
max_execution_time=120
10+
post_max_size = 64M
11+
upload_max_filesize = 64M

0 commit comments

Comments
 (0)