-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9877aeb
commit ea3ee1f
Showing
10 changed files
with
246 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM totara/docker-dev-php84:latest | ||
|
||
RUN apt-get update && apt-get install -y cron | ||
|
||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
RUN chmod +x /entrypoint.sh | ||
|
||
CMD ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
if [ -e /etc/cron.d/*.cron ] | ||
then | ||
# Install new crontab using all .cron files | ||
cat /etc/cron.d/*.cron | crontab - \ | ||
&& crontab -l \ | ||
&& cron -f | ||
else | ||
echo "No .cron files found in cron.d folder" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM totara/docker-dev-php84:latest | ||
|
||
RUN pecl channel-update pecl.php.net && \ | ||
pecl install -f xdebug-3.4.0 && docker-php-ext-enable xdebug.so && \ | ||
pecl install -f pcov && docker-php-ext-enable pcov.so | ||
|
||
RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \ | ||
&& echo "xdebug.start_with_request=trigger" >> /usr/local/etc/php/conf.d/xdebug.ini | ||
|
||
# Set some sensible defaults | ||
RUN echo "pcov.enabled=1" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.exclude='~(vendor|tests|node_modules|.git|client|.scannerwork)~'" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
# The next line can be enabled (and applied with tbuild and tup of this container) to optimise memory usage \ | ||
# Note that PHP's memory limit needs to be high enough. | ||
#&& echo "pcov.initial.memory=1073741824" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini \ | ||
&& echo "pcov.initial.files=30000" >> /usr/local/etc/php/conf.d/docker-php-ext-pcov.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
FROM php:8.4-fpm-bullseye | ||
|
||
ARG TIME_ZONE=Pacific/Auckland | ||
|
||
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
apt-transport-https \ | ||
libfreetype6-dev \ | ||
libjpeg62-turbo-dev \ | ||
libwebp-dev \ | ||
libmcrypt-dev \ | ||
libpng-dev \ | ||
libxml2-dev \ | ||
libicu-dev \ | ||
libpq-dev \ | ||
gnupg2 \ | ||
nano \ | ||
vim \ | ||
wget \ | ||
openssl \ | ||
locales \ | ||
tzdata \ | ||
git \ | ||
libzip-dev \ | ||
libmemcached-dev \ | ||
zip \ | ||
netcat \ | ||
bc \ | ||
ghostscript \ | ||
graphviz \ | ||
aspell \ | ||
libldap2-dev \ | ||
libltdl-dev \ | ||
libc-client-dev \ | ||
libkrb5-dev \ | ||
libssl-dev \ | ||
&& docker-php-ext-install -j$(nproc) \ | ||
zip \ | ||
intl \ | ||
soap \ | ||
opcache \ | ||
pdo_pgsql \ | ||
pdo_mysql \ | ||
pgsql \ | ||
mysqli \ | ||
exif \ | ||
ldap \ | ||
&& docker-php-ext-configure gd \ | ||
--with-freetype \ | ||
--with-jpeg \ | ||
--with-webp \ | ||
&& docker-php-ext-install -j$(nproc) gd | ||
|
||
RUN git clone https://github.com/longxinH/xhprof.git ./xhprof \ | ||
&& cd xhprof \ | ||
&& git checkout v2.3.10 \ | ||
&& cd extension/ \ | ||
&& phpize \ | ||
&& ./configure \ | ||
&& make && make install | ||
|
||
RUN echo "extension=xhprof.so" >> /usr/local/etc/php/conf.d/xhprof.ini \ | ||
&& echo "xhprof.output_dir = /tmp/xhprof" >> /usr/local/etc/php/conf.d/xhprof.ini | ||
|
||
RUN pecl channel-update pecl.php.net && \ | ||
pecl install -o -f redis \ | ||
&& rm -rf /tmp/pear \ | ||
&& docker-php-ext-enable redis | ||
|
||
RUN pecl channel-update pecl.php.net && \ | ||
pecl install -o -f igbinary \ | ||
&& rm -rf /tmp/pear \ | ||
&& docker-php-ext-enable igbinary | ||
|
||
RUN pecl channel-update pecl.php.net && \ | ||
pecl install -o -f memcached \ | ||
&& rm -rf /tmp/pear \ | ||
&& docker-php-ext-enable memcached | ||
|
||
RUN pecl channel-update pecl.php.net && \ | ||
pecl install -o -f imap \ | ||
&& rm -rf /tmp/pear \ | ||
&& docker-php-ext-enable imap | ||
|
||
# we need en_US locales for MSSQL connection to work | ||
# we need en_AU locales for behat to work | ||
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \ | ||
sed -i -e 's/# en_AU.UTF-8 UTF-8/en_AU.UTF-8 UTF-8/' /etc/locale.gen && \ | ||
dpkg-reconfigure --frontend=noninteractive locales && \ | ||
update-locale LANG=en_US.UTF-8 | ||
|
||
ENV LANG=en_US.UTF-8 | ||
ENV LANGUAGE=en_US.UTF-8 | ||
ENV LC_ALL=en_US.UTF-8 | ||
|
||
# install mssql extension | ||
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ | ||
&& curl https://packages.microsoft.com/config/debian/11/prod.list > /etc/apt/sources.list.d/mssql-release.list \ | ||
&& apt-get update && ACCEPT_EULA=Y apt-get install -y \ | ||
msodbcsql18 \ | ||
mssql-tools18 \ | ||
unixodbc-dev | ||
|
||
RUN echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile \ | ||
&& echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc | ||
|
||
# Workaround applied: https://github.com/microsoft/msphpsql/issues/1438#issuecomment-1444773949 | ||
RUN pear config-set php_ini `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` system \ | ||
&& pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 || \ | ||
apt-get install -y --allow-downgrades odbcinst=2.3.7 odbcinst1debian2=2.3.7 unixodbc=2.3.7 unixodbc-dev=2.3.7 && \ | ||
pecl install sqlsrv-5.12.0 pdo_sqlsrv-5.12.0 | ||
|
||
RUN docker-php-ext-enable sqlsrv.so && docker-php-ext-enable pdo_sqlsrv.so | ||
|
||
RUN ln -fs /usr/share/zoneinfo/${TIME_ZONE} /etc/localtime \ | ||
&& dpkg-reconfigure --frontend noninteractive tzdata | ||
|
||
COPY config/php.ini /usr/local/etc/php/ | ||
COPY config/fpm.conf /usr/local/etc/php-fpm.d/zz-totara.conf | ||
|
||
# Source each .sh file found in the /shell/ folder, always source the default_aliases.sh file first | ||
RUN echo 'if [[ -e "/root/custom_shell/default-aliases.sh" ]]; then source "/root/custom_shell/default-aliases.sh"; fi' >> ~/.bashrc && \ | ||
echo 'for f in /root/custom_shell/*.sh; do [[ "$f" != "/root/custom_shell/default-aliases.sh" && -e "$f" ]] && source "$f"; done;' >> ~/.bashrc | ||
|
||
# Have the option of using the oh my zsh shell. | ||
RUN apt-get update && apt-get install -y zsh | ||
RUN sh -c "$(curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" --unattended | ||
RUN git clone https://github.com/romkatv/powerlevel10k ~/.oh-my-zsh/custom/themes/powerlevel10k | ||
RUN git clone https://github.com/zsh-users/zsh-autosuggestions ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions | ||
RUN git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-zsh/custom/plugins/zsh-completions | ||
RUN git clone https://github.com/zsh-users/zsh-syntax-highlighting ~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting | ||
RUN echo 'setopt +o nomatch' > ~/.zshrc | ||
RUN echo 'source ~/custom_shell/.zshrc' >> ~/.zshrc | ||
RUN cat ~/.bashrc >> ~/.zshrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[www] | ||
pm.max_children = 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
log_errors = On | ||
error_log = /dev/stderr | ||
error_reporting = E_ALL & ~E_DEPRECATED | ||
max_input_vars=5000 | ||
date.timezone = Pacific/Auckland | ||
memory_limit=256M | ||
; necessary as Xdebug impacts performance that hard | ||
max_execution_time=120 | ||
post_max_size = 64M | ||
upload_max_filesize = 64M |