Skip to content

Commit

Permalink
Merge pull request #15 from Faks/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Faks authored Jan 10, 2024
2 parents 52a5e59 + 70cc52b commit 044dbb5
Show file tree
Hide file tree
Showing 10 changed files with 176 additions and 57 deletions.
27 changes: 26 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ COMPOSE_PROJECT_NAME=laradock
### PHP Version ###########################################

# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM).
# Accepted values: 8.2 - 8.1 - 8.0 - 7.4 - 7.3 - 7.2 - 7.1 - 7.0 - 5.6
# Accepted values: 8.3 - 8.2 - 8.1 - 8.0 - 7.4 - 7.3 - 7.2 - 7.1 - 7.0 - 5.6
PHP_VERSION=7.4

### Phalcon Version ###########################################
Expand All @@ -61,6 +61,11 @@ DOCKER_HOST_IP=10.0.75.1
# Choose a Remote Interpreter entry matching name. Default is `laradock`
PHP_IDE_CONFIG=serverName=laradock

### PHP USE LEGACY OPENSSL ################################

# Since OpenSSL 3 some ciphers are not available
PHP_LEGACY_OPENSSL=false

### PHP DOWNGRADEOPENSSL TLS AND SECLEVEL #################

PHP_DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL=false
Expand Down Expand Up @@ -409,6 +414,26 @@ MYSQL_PORT=3306
MYSQL_ROOT_PASSWORD=root
MYSQL_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d

### MYSQL Development #################################################

MYSQL_DEVELOPMENT_VERSION=latest
MYSQL_DEVELOPMENT_DATABASE=default
MYSQL_DEVELOPMENT_USER=default
MYSQL_DEVELOPMENT_PASSWORD=secret
MYSQL_DEVELOPMENT_PORT=3306
MYSQL_DEVELOPMENT_ROOT_PASSWORD=root
MYSQL_DEVELOPMENT_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d

### MYSQL Staging #################################################

MYSQL_STAGING_VERSION=latest
MYSQL_STAGING_DATABASE=default
MYSQL_STAGING_USER=default
MYSQL_STAGING_PASSWORD=secret
MYSQL_STAGING_PORT=3306
MYSQL_STAGING_ROOT_PASSWORD=root
MYSQL_STAGING_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d

### CLICKHOUSE #################################################

CLICKHOUSE_VERSION=22.2.2.1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php_version: [ "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" ]
php_version: [ "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" ]
service: [ php-fpm, php-worker, workspace ]
steps:
- uses: actions/checkout@v4
Expand Down
40 changes: 40 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,46 @@ services:
networks:
- backend

### MySQL Development ################################################
mysql-development:
build:
context: ./mysql
args:
- MYSQL_VERSION=${MYSQL_VERSION}
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- TZ=${WORKSPACE_TIMEZONE}
volumes:
- ${DATA_PATH_HOST}/mysql_development:/var/lib/mysql
- ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
ports:
- "${MYSQL_PORT}:3306"
networks:
- backend

### MySQL Staging ################################################
mysql-staging:
build:
context: ./mysql
args:
- MYSQL_VERSION=${MYSQL_VERSION}
environment:
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- TZ=${WORKSPACE_TIMEZONE}
volumes:
- ${DATA_PATH_HOST}/mysql_staging:/var/lib/mysql
- ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
ports:
- "${MYSQL_PORT}:3306"
networks:
- backend

### Percona ################################################
percona:
build:
Expand Down
4 changes: 2 additions & 2 deletions laravel-horizon/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ RUN apk --update add wget \

RUN pecl channel-update pecl.php.net; \
docker-php-ext-install mysqli mbstring pdo pdo_mysql xml pcntl; \
if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "80100" ] || \
[ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "80200" ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ] && \
[ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") != "80000" ]; then \
php -m | grep -oiE '^tokenizer$'; \
else \
docker-php-ext-install tokenizer; \
Expand Down
34 changes: 26 additions & 8 deletions php-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# https://xdebug.org/docs/compat
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ] || { [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && { [ $(php -r "echo PHP_MINOR_VERSION;") = "4" ] || [ $(php -r "echo PHP_MINOR_VERSION;") = "3" ] ;} ;}; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
pecl install xdebug-3.2.1; \
pecl install xdebug-3.3.0; \
else \
pecl install xdebug-3.1.6; \
fi; \
Expand Down Expand Up @@ -366,8 +366,12 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
docker-php-ext-enable mongo; \
php -m | grep -oiE '^mongo$'; \
else \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && { [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ] || [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ] ;}; then \
pecl install mongodb-1.9.2; \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") != "4" ]; then \
if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ] || [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ]; then \
pecl install mongodb-1.9.2; \
else \
pecl install mongodb-1.16.2; \
fi; \
else \
pecl install mongodb; \
fi; \
Expand Down Expand Up @@ -765,7 +769,7 @@ RUN set -eux; \
# Add Microsoft repo for Microsoft ODBC Driver 13 for Linux \
apt-get update \
&& apt-get install -yqq apt-transport-https gnupg lsb-release \
&& if [ ${LARADOCK_PHP_VERSION} = "8.1" ] || [ ${LARADOCK_PHP_VERSION} = "8.2" ]; then \
&& if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ] && [ ${LARADOCK_PHP_VERSION} != "8.0" ]; then \
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg \
;else \
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
Expand Down Expand Up @@ -1175,8 +1179,8 @@ RUN if [ ${INSTALL_PHPDECIMAL} = true ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
echo 'decimal not support PHP 5.6'; \
else \
if [ ${LARADOCK_PHP_VERSION} = "8.1" ] || \
[ ${LARADOCK_PHP_VERSION} = "8.2" ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ] && \
[ ${LARADOCK_PHP_VERSION} != "8.0" ]; then \
curl -L -o /tmp/mpdecimal.tar.gz "https://www.bytereef.org/software/mpdecimal/releases/mpdecimal-2.5.1.tar.gz"; \
mkdir -p /tmp/mpdecimal; \
tar -C /tmp/mpdecimal -zxvf /tmp/mpdecimal.tar.gz --strip 1; \
Expand Down Expand Up @@ -1223,8 +1227,8 @@ ARG NEW_RELIC=${NEW_RELIC}
ARG NEW_RELIC_KEY=${NEW_RELIC_KEY}
ARG NEW_RELIC_APP_NAME=${NEW_RELIC_APP_NAME}

RUN if [ ${NEW_RELIC} = true ]; then \
curl -L http://download.newrelic.com/php_agent/archive/10.13.0.2/newrelic-php5-10.13.0.2-linux.tar.gz | tar -C /tmp -zx && \
RUN if [ ${NEW_RELIC} = true ] && [ ${LARADOCK_PHP_VERSION} != "8.3" ]; then \
curl -L http://download.newrelic.com/php_agent/archive/10.14.0.3/newrelic-php5-10.14.0.3-linux.tar.gz | tar -C /tmp -zx && \
export NR_INSTALL_USE_CP_NOT_LN=1 && \
export NR_INSTALL_SILENT=1 && \
/tmp/newrelic-php5-*/newrelic-install install && \
Expand Down Expand Up @@ -1263,6 +1267,20 @@ RUN set -xe; \
&& rm /tmp/ssdb-client-php.tar.gz \
&& docker-php-ext-enable ssdb \
;fi

###########################################################################
# Legacy Openssl Config:
###########################################################################
ARG LEGACY_OPENSSL=false

RUN if [ ${LEGACY_OPENSSL} = true ]; then \
if openssl version | grep -q "OpenSSL 3"; then \
sed -i 's/# providers = provider_sect/providers = provider_sect/g' /etc/ssl/openssl.cnf && \
sed -i '$a[provider_sect]\ndefault=default_sect\nlegacy=legacy_sect\n' /etc/ssl/openssl.cnf && \
sed -i '$a[default_sect]\nactivate=1\n[legacy_sect]\nactivate=1\n' /etc/ssl/openssl.cnf \
;fi \
;fi

###########################################################################
# Downgrade Openssl:
###########################################################################
Expand Down
66 changes: 35 additions & 31 deletions php-fpm/php8.3.ini
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@

; php.ini-production contains settings which hold security, performance and
; best practices at its core. But please be aware, these settings may break
; compatibility with older or less security conscience applications. We
; compatibility with older or less security-conscious applications. We
; recommending using the production ini in production and testing environments.

; php.ini-development is very similar to its production variant, except it is
Expand Down Expand Up @@ -144,6 +144,11 @@
; Development Value: 5
; Production Value: 5

; session.sid_length
; Default Value: 32
; Development Value: 26
; Production Value: 26

; short_open_tag
; Default Value: On
; Development Value: Off
Expand All @@ -154,6 +159,11 @@
; Development Value: "GPCS"
; Production Value: "GPCS"

; zend.assertions
; Default Value: 1
; Development Value: 1
; Production Value: -1

; zend.exception_ignore_args
; Default Value: Off
; Development Value: Off
Expand Down Expand Up @@ -423,6 +433,11 @@ max_input_time = 60
; How many GET/POST/COOKIE input variables may be accepted
;max_input_vars = 1000

; How many multipart body parts (combined input variable and file uploads) may
; be accepted.
; Default Value: -1 (Sum of max_input_vars and max_file_uploads)
;max_multipart_body_parts = 1500

; Maximum amount of memory a script may consume
; https://php.net/memory-limit
memory_limit = 128M
Expand Down Expand Up @@ -913,6 +928,12 @@ default_socket_timeout = 60
; Be sure to appropriately set the extension_dir directive.
;
;extension=bz2

; The ldap extension must be before curl if OpenSSL 1.0.2 and OpenLDAP is used
; otherwise it results in segfault when unloading after using SASL.
; See https://github.com/php/php-src/issues/8620 for more info.
;extension=ldap

;extension=curl
;extension=ffi
;extension=ftp
Expand All @@ -922,7 +943,6 @@ default_socket_timeout = 60
;extension=gmp
;extension=intl
;extension=imap
;extension=ldap
;extension=mbstring
;extension=exif ; Must be after mbstring as it depends on it
;extension=mysqli
Expand All @@ -949,6 +969,7 @@ default_socket_timeout = 60
;extension=sqlite3
;extension=tidy
;extension=xsl
;extension=zip

;zend_extension=opcache

Expand Down Expand Up @@ -1089,6 +1110,10 @@ smtp_port = 25
; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = Off

; Use mixed LF and CRLF line separators to keep compatibility with some
; RFC 2822 non conformant MTA.
mail.mixed_lf_and_crlf = Off

; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
Expand Down Expand Up @@ -1186,9 +1211,6 @@ mysqli.default_user =
; https://php.net/mysqli.default-pw
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = Off

; If this option is enabled, closing a persistent connection will rollback
; any pending transactions of this connection, before it is put back
; into the persistent connection pool.
Expand Down Expand Up @@ -1576,33 +1598,14 @@ session.sid_bits_per_character = 5
; -1: Do not compile at all
; 0: Jump over assertion at run-time
; 1: Execute assertions
; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1)
; Changing from or to a negative value is only possible in php.ini!
; (For turning assertions on and off at run-time, toggle zend.assertions between the values 1 and 0)
; Default Value: 1
; Development Value: 1
; Production Value: -1
; https://php.net/zend.assertions
zend.assertions = 1

; Assert(expr); active by default.
; https://php.net/assert.active
;assert.active = On

; Throw an AssertionError on failed assertions
; https://php.net/assert.exception
;assert.exception = On

; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active)
; https://php.net/assert.warning
;assert.warning = On

; Don't bail out by default.
; https://php.net/assert.bail
;assert.bail = Off

; User-function to be called if an assertion fails.
; https://php.net/assert.callback
;assert.callback = 0

[COM]
; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs
; https://php.net/com.typelib-file
Expand Down Expand Up @@ -1835,10 +1838,6 @@ ldap.max_links = -1
; are cached.
;opcache.max_file_size=0

; Check the cache checksum each N requests.
; The default value of "0" means that the checks are disabled.
;opcache.consistency_checks=0

; How long to wait (in seconds) for a scheduled restart to begin if the cache
; is not being accessed.
;opcache.force_restart_timeout=180
Expand Down Expand Up @@ -1890,7 +1889,12 @@ ldap.max_links = -1
;opcache.file_cache_fallback=1

; Enables or disables copying of PHP code (text segment) into HUGE PAGES.
; This should improve performance, but requires appropriate OS configuration.
; Under certain circumstances (if only a single global PHP process is
; started from which all others fork), this can increase performance
; by a tiny amount because TLB misses are reduced. On the other hand, this
; delays PHP startup, increases memory usage and degrades performance
; under memory pressure - use with care.
; Requires appropriate OS configuration.
;opcache.huge_code_pages=0

; Validate cached file permissions.
Expand Down
12 changes: 8 additions & 4 deletions php-worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ RUN apk --update add wget \

RUN pecl channel-update pecl.php.net; \
docker-php-ext-install mysqli mbstring pdo pdo_mysql xml pcntl; \
if [ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "80100" ] || \
[ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") = "80200" ]; then \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ] && \
[ $(php -r "echo PHP_VERSION_ID - PHP_RELEASE_VERSION;") != "80000" ]; then \
php -m | grep -oiE '^tokenizer$'; \
else \
docker-php-ext-install tokenizer; \
Expand Down Expand Up @@ -164,8 +164,12 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
docker-php-ext-enable mongo; \
php -m | grep -oiE '^mongo$'; \
else \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && { [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ] || [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ] ;}; then \
pecl install mongodb-1.9.2; \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") != "4" ]; then \
if [ $(php -r "echo PHP_MINOR_VERSION;") = "0" ] || [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ]; then \
pecl install mongodb-1.9.2; \
else \
pecl install mongodb-1.16.2; \
fi; \
else \
pecl install mongodb; \
fi; \
Expand Down
Loading

0 comments on commit 044dbb5

Please sign in to comment.