Browse Source

Merge remote-tracking branch 'origin/master'

master
parent
commit
5cf2889c55
  1. 4
      .env.example
  2. 1
      config/nginx/conf.d/vhosts.conf.example
  3. 2
      config/nginx/includes.d/staticfiles.conf
  4. 5
      docker-compose.base.yml
  5. 14
      dockerfiles/php-fpm/php73.Dockerfile
  6. 10
      dockerfiles/php-fpm/php74.Dockerfile
  7. 12
      dockerfiles/php-fpm/xdebug.ini
  8. 1
      dockerfiles/workspace/.gitignore
  9. 23
      dockerfiles/workspace/aliases.sh.example
  10. 44
      dockerfiles/workspace/workspace73.Dockerfile
  11. 51
      dockerfiles/workspace/workspace74.Dockerfile
  12. 6
      dockerfiles/workspace/xdebug.sh
  13. 20
      src/.env
  14. 39
      src/README.md
  15. 15
      src/docker-compose.base.yml
  16. 24
      src/dockerfiles/php-fpm/php.base.Dockerfile
  17. 2
      src/dockerfiles/php-fpm/xdebug.ini
  18. 100
      src/dockerfiles/workspace/workspace.base.Dockerfile
  19. 5
      src/dockerfiles/workspace/workspace73.Dockerfile
  20. 5
      src/dockerfiles/workspace/workspace74.Dockerfile
  21. 7
      src/dockerfiles/workspace/xdebug.ini

4
.env.example

@ -14,8 +14,8 @@ INSTALL_PEAR_MAIL=true
PHP_OPT_SHORT_OPEN_TAG=On PHP_OPT_SHORT_OPEN_TAG=On
PHP_OPT_MAX_EXECUTION_TIME=600 PHP_OPT_MAX_EXECUTION_TIME=600
PHP_OPT_MEMORY_LIMIT=500M PHP_OPT_MEMORY_LIMIT=500M
PHP_OPT_POST_MAX_SIZE=200M
PHP_OPT_UPLOAD_MAX_FILESIZE=20M
PHP_OPT_POST_MAX_SIZE=48M
PHP_OPT_UPLOAD_MAX_FILESIZE=16M
### MINIO S3 ############################################# ### MINIO S3 #############################################
MINIO_ACCESS_KEY=s3.local MINIO_ACCESS_KEY=s3.local

1
config/nginx/conf.d/vhosts.conf.example

@ -35,7 +35,6 @@ server {
} }
} }
server { server {
server_name server_name
loc.octobercmswebp loc.octobercmswebp

2
config/nginx/includes.d/staticfiles.conf

@ -21,7 +21,7 @@ location = /empty {
expires 0; expires 0;
empty_gif; empty_gif;
} }
location ~* \.(eot|ttf|woff|woff2|pdf|css|js)$ {
location ~* \.(eot|ttf|woff|woff2|otf|pdf|css|js|mp4)$ {
try_files $uri /404; try_files $uri /404;
access_log off; access_log off;
expires max; expires max;

5
docker-compose.base.yml

@ -39,6 +39,11 @@ services:
- CUSTOM_PGID=${WORKSPACE_PGID} - CUSTOM_PGID=${WORKSPACE_PGID}
- CUSTOM_TZ=${WORKSPACE_TIMEZONE} - CUSTOM_TZ=${WORKSPACE_TIMEZONE}
- CUSTOM_NODE_VERSION=${WORKSPACE_CUSTOM_NODE_VERSION} - CUSTOM_NODE_VERSION=${WORKSPACE_CUSTOM_NODE_VERSION}
- PHP_OPT_SHORT_OPEN_TAG=${PHP_OPT_SHORT_OPEN_TAG}
- PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME}
- PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT}
- PHP_OPT_POST_MAX_SIZE=${PHP_OPT_POST_MAX_SIZE}
- PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE}
restart: always restart: always
volumes: volumes:
- ${PROJECTS_DIR}:/var/www - ${PROJECTS_DIR}:/var/www

14
dockerfiles/php-fpm/php73.Dockerfile

@ -33,20 +33,26 @@ RUN if [ ${INSTALL_PEAR_MAIL} = true ]; then \
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
########################################################################### ###########################################################################
# Permission denied on /tmp folder:
###########################################################################
RUN chmod 1777 /tmp
###########################################################################
# Tune opts: # Tune opts:
########################################################################### ###########################################################################
ARG PHP_OPT_SHORT_OPEN_TAG=Off ARG PHP_OPT_SHORT_OPEN_TAG=Off
RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_MAX_EXECUTION_TIME=30
ARG PHP_OPT_MAX_EXECUTION_TIME=600
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_MEMORY_LIMIT=128M
ARG PHP_OPT_MEMORY_LIMIT=256M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_MEMORY_LIMIT=128M
ARG PHP_OPT_POST_MAX_SIZE=48M
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_POST_MAX_SIZE/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_POST_MAX_SIZE/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=2M
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"

10
dockerfiles/php-fpm/php74.Dockerfile

@ -35,6 +35,7 @@ COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
########################################################################### ###########################################################################
# Permission denied on /tmp folder: # Permission denied on /tmp folder:
########################################################################### ###########################################################################
RUN chmod 1777 /tmp RUN chmod 1777 /tmp
########################################################################### ###########################################################################
@ -44,11 +45,14 @@ RUN chmod 1777 /tmp
ARG PHP_OPT_SHORT_OPEN_TAG=Off ARG PHP_OPT_SHORT_OPEN_TAG=Off
RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_MAX_EXECUTION_TIME=30
ARG PHP_OPT_MAX_EXECUTION_TIME=600
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_MEMORY_LIMIT=128M
ARG PHP_OPT_MEMORY_LIMIT=256M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=2M
ARG PHP_OPT_POST_MAX_SIZE=48M
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_POST_MAX_SIZE/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"

12
dockerfiles/php-fpm/xdebug.ini

@ -1,15 +1,15 @@
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
; NOTE: The actual xdebug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
;xdebug.remote_host=dockerhost ;xdebug.remote_host=dockerhost
xdebug.remote_connect_back=1 xdebug.remote_connect_back=1
xdebug.remote_port=9000 xdebug.remote_port=9000
xdebug.idekey=PHPSTORM xdebug.idekey=PHPSTORM
xdebug.remote_autostart=0
xdebug.remote_enable=0
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.cli_color=0 xdebug.cli_color=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=0
xdebug.profiler_enable=1
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=/tmp xdebug.profiler_output_dir=/tmp
xdebug.remote_handler=dbgp xdebug.remote_handler=dbgp
@ -23,4 +23,4 @@ xdebug.trace_enable_trigger=1
xdebug.trace_output_dir=/tmp xdebug.trace_output_dir=/tmp
xdebug.trace_output_name="trace.%t" xdebug.trace_output_name="trace.%t"
xdebug.show_exception_trace=0
xdebug.show_exception_trace=1

1
dockerfiles/workspace/.gitignore

@ -0,0 +1 @@
/aliases.sh

23
dockerfiles/workspace/aliases.sh.example

@ -0,0 +1,23 @@
#! /bin/bash
# Colors used for status updates
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
COL_YELLOW=$ESC_SEQ"33;01m"
COL_BLUE=$ESC_SEQ"34;01m"
COL_MAGENTA=$ESC_SEQ"35;01m"
COL_CYAN=$ESC_SEQ"36;01m"
# Detect which `ls` flavor is in use
if ls --color > /dev/null 2>&1; then # GNU `ls`
colorflag="--color"
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
else # macOS `ls`
colorflag="-G"
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
fi
# Always use color output for `ls`
alias ls="command ls ${colorflag}"

44
dockerfiles/workspace/workspace73.Dockerfile

@ -1,5 +1,7 @@
FROM dimti/workspace:7.3 FROM dimti/workspace:7.3
ARG PHP_VERSION=7.3
########################################################################### ###########################################################################
# Laradock non-root user: # Laradock non-root user:
########################################################################### ###########################################################################
@ -28,7 +30,7 @@ RUN ln -snf /usr/share/zoneinfo/$CUSTOM_TZ /etc/localtime && echo $CUSTOM_TZ > /
RUN pecl install -a redis RUN pecl install -a redis
RUN echo "extension=redis.so" > /etc/php/7.3/cli/conf.d/20-redis.ini
RUN echo "extension=redis.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-redis.ini
########################################################################### ###########################################################################
# S3 config # S3 config
@ -62,6 +64,46 @@ RUN if [ ! -z "${CUSTOM_NODE_VERSION}" ]; then \
RUN sed -i 's/^mozilla\/DST_Root_CA_X3\.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf && update-ca-certificates RUN sed -i 's/^mozilla\/DST_Root_CA_X3\.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf && update-ca-certificates
########################################################################### ###########################################################################
# Laradock Aliases
###########################################################################
USER laradock
COPY ./aliases.sh /home/laradock/aliases.sh
RUN echo "" >> ~/.bashrc && \
echo "# Load Custom Aliases" >> ~/.bashrc && \
echo "source ~/aliases.sh" >> ~/.bashrc && \
echo "" >> ~/.bashrc
###########################################################################
# S3 config
###########################################################################
USER laradock
COPY ./minio/auth.json /home/laradock/.mc/config.json
###########################################################################
# Tune opts:
###########################################################################
ARG PHP_OPT_SHORT_OPEN_TAG=Off
RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_MAX_EXECUTION_TIME=600
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_MEMORY_LIMIT=256M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_POST_MAX_SIZE=48M
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" /etc/php/${PHP_VERSION}/cli/php.ini
###########################################################################
# Crontab # Crontab
########################################################################### ###########################################################################

51
dockerfiles/workspace/workspace74.Dockerfile

@ -1,4 +1,6 @@
FROM dimti/workspace:7.4
FROM src_workspace74:latest
ARG PHP_VERSION=7.4
########################################################################### ###########################################################################
# Laradock non-root user: # Laradock non-root user:
@ -29,15 +31,7 @@ RUN ln -snf /usr/share/zoneinfo/$CUSTOM_TZ /etc/localtime && echo $CUSTOM_TZ > /
#RUN pecl install igbinary && pecl install -a redis #RUN pecl install igbinary && pecl install -a redis
RUN pecl install -a redis RUN pecl install -a redis
RUN echo "extension=redis.so" > /etc/php/7.4/cli/conf.d/20-redis.ini
###########################################################################
# S3 config
###########################################################################
USER laradock
COPY ./minio/auth.json /home/laradock/.mc/config.json
RUN echo "extension=redis.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-redis.ini
########################################################################### ###########################################################################
# Install custom node version # Install custom node version
@ -63,6 +57,43 @@ RUN if [ ! -z "${CUSTOM_NODE_VERSION}" ]; then \
RUN sed -i 's/^mozilla\/DST_Root_CA_X3\.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf && update-ca-certificates RUN sed -i 's/^mozilla\/DST_Root_CA_X3\.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf && update-ca-certificates
########################################################################### ###########################################################################
# Laradock Aliases
###########################################################################
USER laradock
COPY ./aliases.sh /home/laradock/aliases.sh
RUN echo "" >> ~/.bashrc && \
echo "# Load Custom Aliases" >> ~/.bashrc && \
echo "source ~/aliases.sh" >> ~/.bashrc && \
echo "" >> ~/.bashrc
###########################################################################
# S3 config
###########################################################################
USER laradock
COPY ./minio/auth.json /home/laradock/.mc/config.json
###########################################################################
# Tune opts:
###########################################################################
ARG PHP_OPT_MAX_EXECUTION_TIME=600
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_MEMORY_LIMIT=256M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_POST_MAX_SIZE=48M
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" /etc/php/${PHP_VERSION}/cli/php.ini
###########################################################################
# Crontab # Crontab
########################################################################### ###########################################################################

6
dockerfiles/workspace/xdebug.sh

@ -25,12 +25,12 @@ xdebug_start ()
echo 'Start xDebug' echo 'Start xDebug'
# And uncomment line with xdebug extension, thus enabling it # And uncomment line with xdebug extension, thus enabling it
ON_CMD="sed -i 's/^;zend_extension=/zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
ON_CMD='sed -i "s/^;zend_extension=/zend_extension=/g" /etc/php/$PHP_VERSION/cli/conf.d/20-xdebug.ini'
docker exec -it $WORKSPACE_CONTAINER bash -c "${ON_CMD}" docker exec -it $WORKSPACE_CONTAINER bash -c "${ON_CMD}"
docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v' docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'
echo 'In cli use this for resolve hostname for debugger in your IDE :'
echo 'In cli use this for resolve hostname for debugger in your IDE:'
echo 'export PHP_IDE_CONFIG="serverName=loc.mydomain.ru"' echo 'export PHP_IDE_CONFIG="serverName=loc.mydomain.ru"'
} }
@ -40,7 +40,7 @@ xdebug_stop ()
echo 'Stop xDebug' echo 'Stop xDebug'
# Comment out xdebug extension line # Comment out xdebug extension line
OFF_CMD="sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
OFF_CMD='sed -i "s/^zend_extension=/;zend_extension=/g" /etc/php/$PHP_VERSION/cli/conf.d/20-xdebug.ini'
docker exec -it $WORKSPACE_CONTAINER bash -c "${OFF_CMD}" docker exec -it $WORKSPACE_CONTAINER bash -c "${OFF_CMD}"
docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v' docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'

20
src/.env

@ -4,20 +4,21 @@ WORKSPACE_PGID=1000
WORKSPACE_TIMEZONE=Europe/Moscow WORKSPACE_TIMEZONE=Europe/Moscow
WORKSPACE_INSTALL_SSH=true WORKSPACE_INSTALL_SSH=true
WORKSPACE_INSTALL_MYSQL_CLIENT=true WORKSPACE_INSTALL_MYSQL_CLIENT=true
WORKSPACE_INSTALL_PYTHON=true
WORKSPACE_INSTALL_FSWATCH=false WORKSPACE_INSTALL_FSWATCH=false
WORKSPACE_INSTALL_PING=true WORKSPACE_INSTALL_PING=true
WORKSPACE_INSTALL_S3_MINIO_CLIENT=true WORKSPACE_INSTALL_S3_MINIO_CLIENT=true
WORKSPACE_INSTALL_XDEBUG=true
WORKSPACE_INSTALL_BZ2=true
# PHP-extensions already installed: INTL, PGSQL, BCMATH
WORKSPACE_INSTALL_WP_CLI=true
WORKSPACE_INSTALL_NODE=true
WORKSPACE_INSTALL_GULP=true
WORKSPACE_INSTALL_YARN=true
WORKSPACE_COMPOSER_VERSION=1 WORKSPACE_COMPOSER_VERSION=1
WORKSPACE_COMPOSER_GLOBAL_INSTALL=true WORKSPACE_COMPOSER_GLOBAL_INSTALL=true
WORKSPACE_COMPOSER_REPO_PACKAGIST= WORKSPACE_COMPOSER_REPO_PACKAGIST=
WORKSPACE_INSTALL_XDEBUG=false
WORKSPACE_INSTALL_WP_CLI=true
WORKSPACE_INSTALL_NODE=true
WORKSPACE_NODE_VERSION=lts/dubnium WORKSPACE_NODE_VERSION=lts/dubnium
WORKSPACE_NPM_REGISTRY= WORKSPACE_NPM_REGISTRY=
WORKSPACE_INSTALL_GULP=true
WORKSPACE_INSTALL_YARN=true
WORKSPACE_YARN_VERSION=latest WORKSPACE_YARN_VERSION=latest
### PHP-FPM ############################################# ### PHP-FPM #############################################
@ -25,11 +26,12 @@ INSTALL_XDEBUG=true
INSTALL_REDIS=true INSTALL_REDIS=true
INSTALL_ZIP=true INSTALL_ZIP=true
INSTALL_BZ2=true INSTALL_BZ2=true
INSTALL_OPCACHE=true
INSTALL_INTL=true INSTALL_INTL=true
INSTALL_PGSQL=true INSTALL_PGSQL=true
INSTALL_BCMATH=true INSTALL_BCMATH=true
PHP_OPT_SHORT_OPEN_TAG=On
PHP_OPT_MAX_EXECUTION_TIME=600 PHP_OPT_MAX_EXECUTION_TIME=600
PHP_OPT_MEMORY_LIMIT=500M
PHP_OPT_UPLOAD_MAX_FILESIZE=20M
PHP_OPT_MEMORY_LIMIT=256M
PHP_OPT_POST_MAX_SIZE=48M
PHP_OPT_UPLOAD_MAX_FILESIZE=16M

39
src/README.md

@ -0,0 +1,39 @@
## For use DOCKER_BUILD_KIT
Set bash env vars:
```bash
export DOCKER_BUILDKIT=1
export COMPOSE_DOCKER_CLI_BUILD=1
```
## Recommended aliases
```bash
alias dc='docker-compose'
alias dils='docker image ls | grep'
alias dirm='docker image rm'
```
## Visualize docker images tree
https://github.com/justone/dockviz
### Setup
Add into your `~/.bash_aliases`:
`alias dockviz="docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock nate/dockviz"`
For use visualization with `/usr/bin/dot`
`apt install graphviz`
### Containers
`dockviz containers -d | dot -Tpng -o ~/containers.png`
### Images
`dockviz images -d | dot -Tpng -o ~/images.png`

15
src/docker-compose.base.yml

@ -8,12 +8,13 @@ services:
- INSTALL_XDEBUG=${INSTALL_XDEBUG} - INSTALL_XDEBUG=${INSTALL_XDEBUG}
- INSTALL_ZIP=${INSTALL_ZIP} - INSTALL_ZIP=${INSTALL_ZIP}
- INSTALL_BZ2=${INSTALL_BZ2} - INSTALL_BZ2=${INSTALL_BZ2}
- INSTALL_OPCACHE=${INSTALL_OPCACHE}
- INSTALL_INTL=${INSTALL_INTL} - INSTALL_INTL=${INSTALL_INTL}
- INSTALL_PGSQL=${INSTALL_PGSQL} - INSTALL_PGSQL=${INSTALL_PGSQL}
- INSTALL_BCMATH=${INSTALL_BCMATH} - INSTALL_BCMATH=${INSTALL_BCMATH}
- PHP_OPT_SHORT_OPEN_TAG=${PHP_OPT_SHORT_OPEN_TAG}
- PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME} - PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME}
- PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT} - PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT}
- PHP_OPT_POST_MAX_SIZE=${PHP_OPT_POST_MAX_SIZE}
- PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE} - PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE}
workspace: workspace:
build: build:
@ -24,18 +25,22 @@ services:
- TZ=${WORKSPACE_TIMEZONE} - TZ=${WORKSPACE_TIMEZONE}
- INSTALL_SSH=${WORKSPACE_INSTALL_SSH} - INSTALL_SSH=${WORKSPACE_INSTALL_SSH}
- INSTALL_MYSQL_CLIENT=${WORKSPACE_INSTALL_MYSQL_CLIENT} - INSTALL_MYSQL_CLIENT=${WORKSPACE_INSTALL_MYSQL_CLIENT}
- INSTALL_PYTHON=${WORKSPACE_INSTALL_PYTHON}
- INSTALL_FSWATCH=${WORKSPACE_INSTALL_FSWATCH} - INSTALL_FSWATCH=${WORKSPACE_INSTALL_FSWATCH}
- INSTALL_PING=${WORKSPACE_INSTALL_PING} - INSTALL_PING=${WORKSPACE_INSTALL_PING}
- INSTALL_S3_MINIO_CLIENT=${WORKSPACE_INSTALL_S3_MINIO_CLIENT} - INSTALL_S3_MINIO_CLIENT=${WORKSPACE_INSTALL_S3_MINIO_CLIENT}
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
- INSTALL_BZ2=${WORKSPACE_INSTALL_BZ2}
- COMPOSER_VERSION=${WORKSPACE_COMPOSER_VERSION} - COMPOSER_VERSION=${WORKSPACE_COMPOSER_VERSION}
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL} - COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
- COMPOSER_REPO_PACKAGIST=${WORKSPACE_COMPOSER_REPO_PACKAGIST} - COMPOSER_REPO_PACKAGIST=${WORKSPACE_COMPOSER_REPO_PACKAGIST}
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
- INSTALL_WP_CLI=${WORKSPACE_INSTALL_WP_CLI} - INSTALL_WP_CLI=${WORKSPACE_INSTALL_WP_CLI}
- INSTALL_NODE=${WORKSPACE_INSTALL_NODE} - INSTALL_NODE=${WORKSPACE_INSTALL_NODE}
- NODE_VERSION=${WORKSPACE_NODE_VERSION}
- NPM_REGISTRY=${WORKSPACE_NPM_REGISTRY}
- INSTALL_GULP=${WORKSPACE_INSTALL_GULP} - INSTALL_GULP=${WORKSPACE_INSTALL_GULP}
- INSTALL_YARN=${WORKSPACE_INSTALL_YARN} - INSTALL_YARN=${WORKSPACE_INSTALL_YARN}
- NODE_VERSION=${WORKSPACE_NODE_VERSION}
- NPM_REGISTRY=${WORKSPACE_NPM_REGISTRY}
- YARN_VERSION=${WORKSPACE_YARN_VERSION} - YARN_VERSION=${WORKSPACE_YARN_VERSION}
- PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME}
- PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT}
- PHP_OPT_POST_MAX_SIZE=${PHP_OPT_POST_MAX_SIZE}
- PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE}

24
src/dockerfiles/php-fpm/php.base.Dockerfile

@ -55,6 +55,17 @@ RUN if [ ${INSTALL_BZ2} = true ]; then \
;fi ;fi
########################################################################### ###########################################################################
# OPCACHE:
###########################################################################
ARG INSTALL_OPCACHE=false
RUN if [ ${INSTALL_OPCACHE} = true ]; then \
docker-php-ext-install opcache \
&& docker-php-ext-enable opcache \
;fi
###########################################################################
# INTL: # INTL:
########################################################################### ###########################################################################
@ -98,7 +109,6 @@ RUN apt --allow-releaseinfo-change update && \
sed -i 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \ sed -i 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen locale-gen
########################################################################### ###########################################################################
# Prepend nginx 502 on showing errors: # Prepend nginx 502 on showing errors:
# @see https://stackoverflow.com/questions/55260221/laravel-php-7-3-nginx-502-upstream-prematurely-closed-fastcgi-stdout # @see https://stackoverflow.com/questions/55260221/laravel-php-7-3-nginx-502-upstream-prematurely-closed-fastcgi-stdout
@ -117,14 +127,14 @@ RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
# Tune opts: # Tune opts:
########################################################################### ###########################################################################
ARG PHP_OPT_SHORT_OPEN_TAG=Off
RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_MAX_EXECUTION_TIME=30
ARG PHP_OPT_MAX_EXECUTION_TIME=600
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_MEMORY_LIMIT=128M
ARG PHP_OPT_MEMORY_LIMIT=256M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=2M
ARG PHP_OPT_POST_MAX_SIZE=48M
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini" RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"

2
src/dockerfiles/php-fpm/xdebug.ini

@ -1,4 +1,4 @@
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
; NOTE: The actual xdebug.so extension is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
;xdebug.remote_host=dockerhost ;xdebug.remote_host=dockerhost
xdebug.remote_connect_back=1 xdebug.remote_connect_back=1

100
src/dockerfiles/workspace/workspace.base.Dockerfile

@ -78,28 +78,18 @@ ENV TZ ${TZ}
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
########################################################################### ###########################################################################
# User Aliases
# Root Aliases
########################################################################### ###########################################################################
USER root USER root
COPY ./aliases.sh /root/aliases.sh COPY ./aliases.sh /root/aliases.sh
COPY ./aliases.sh /home/laradock/aliases.sh
RUN sed -i 's/\r//' /root/aliases.sh && \ RUN sed -i 's/\r//' /root/aliases.sh && \
sed -i 's/\r//' /home/laradock/aliases.sh && \
chown laradock:laradock /home/laradock/aliases.sh && \
echo "" >> ~/.bashrc && \ echo "" >> ~/.bashrc && \
echo "# Load Custom Aliases" >> ~/.bashrc && \ echo "# Load Custom Aliases" >> ~/.bashrc && \
echo "source ~/aliases.sh" >> ~/.bashrc && \ echo "source ~/aliases.sh" >> ~/.bashrc && \
echo "" >> ~/.bashrc
USER laradock
RUN echo "" >> ~/.bashrc && \
echo "# Load Custom Aliases" >> ~/.bashrc && \
echo "source ~/aliases.sh" >> ~/.bashrc && \
echo "" >> ~/.bashrc
echo "" >> ~/.bashrc \
########################################################################### ###########################################################################
# ssh: # ssh:
@ -136,20 +126,6 @@ RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
;fi ;fi
########################################################################### ###########################################################################
# PYTHON:
###########################################################################
USER root
ARG INSTALL_PYTHON=false
RUN if [ ${INSTALL_PYTHON} = true ]; then \
apt-get update && apt-get -y install python python-pip python-dev build-essential \
&& python -m pip install --upgrade "pip < 21.0" \
&& python -m pip install --upgrade virtualenv \
;fi
###########################################################################
# fswatch # fswatch
########################################################################### ###########################################################################
@ -191,6 +167,32 @@ RUN if [ ${INSTALL_S3_MINIO_CLIENT} = true ]; then \
; fi ; fi
########################################################################### ###########################################################################
# xDebug:
###########################################################################
# Copy xdebug configuration for remote debugging
COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Load the xdebug extension only with phpunit commands
apt-get install -y php${PHP_VERSION}-xdebug && \
sed -i 's/^zend_extension=/;zend_extension=/g' /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \
;fi
###########################################################################
# BZ2:
###########################################################################
ARG INSTALL_BZ2=false
RUN if [ ${INSTALL_BZ2} = true ]; then \
apt-get install -y php${PHP_VERSION}-bz2 \
;fi
###########################################################################
# Composer: # Composer:
########################################################################### ###########################################################################
@ -252,28 +254,6 @@ RUN echo "" >> ~/.bashrc && \
RUN set -xe; php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}." RUN set -xe; php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}."
########################################################################### ###########################################################################
# xDebug:
###########################################################################
USER root
ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Load the xdebug extension only with phpunit commands
apt-get install -y php${PHP_VERSION}-xdebug && \
sed -i 's/^;//g' /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \
;fi
# ADD for REMOTE debugging
COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
###########################################################################
# WP CLI: # WP CLI:
########################################################################### ###########################################################################
@ -420,6 +400,30 @@ RUN if [ ${INSTALL_YARN} = true ]; then \
# Add PATH for YARN # Add PATH for YARN
ENV PATH $PATH:/home/laradock/.yarn/bin ENV PATH $PATH:/home/laradock/.yarn/bin
###########################################################################
# Remove DST_Root_CA3
###########################################################################
USER root
RUN sed -i 's/^mozilla\/DST_Root_CA_X3\.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf && update-ca-certificates
###########################################################################
# Tune opts:
###########################################################################
ARG PHP_OPT_MAX_EXECUTION_TIME=600
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_MEMORY_LIMIT=256M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_POST_MAX_SIZE=48M
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" /etc/php/${PHP_VERSION}/cli/php.ini
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Final Touch # Final Touch

5
src/dockerfiles/workspace/workspace73.Dockerfile

@ -1,6 +1,7 @@
# syntax = edrevo/dockerfile-plus # syntax = edrevo/dockerfile-plus
ARG PHP_VERSION=7.3
FROM laradock/workspace:latest-7.3
FROM laradock/workspace:latest-${PHP_VERSION}
ARG PHP_VERSION=7.3
ENV PHP_VERSION ${PHP_VERSION}
INCLUDE+ ./workspace.base.Dockerfile INCLUDE+ ./workspace.base.Dockerfile

5
src/dockerfiles/workspace/workspace74.Dockerfile

@ -1,6 +1,7 @@
# syntax = edrevo/dockerfile-plus # syntax = edrevo/dockerfile-plus
ARG PHP_VERSION=7.4
FROM laradock/workspace:latest-7.4
FROM laradock/workspace:latest-${PHP_VERSION}
ARG PHP_VERSION=7.4
ENV PHP_VERSION ${PHP_VERSION}
INCLUDE+ ./workspace.base.Dockerfile INCLUDE+ ./workspace.base.Dockerfile

7
src/dockerfiles/workspace/xdebug.ini

@ -1,4 +1,4 @@
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
; NOTE: The actual xdebug.so extension is NOT SET HERE but rather (/etc/php/7.4/conf.d/20-xdebug.ini)
xdebug.remote_host=dockerhost xdebug.remote_host=dockerhost
xdebug.remote_connect_back=0 xdebug.remote_connect_back=0
@ -9,7 +9,7 @@ xdebug.remote_autostart=0
xdebug.remote_enable=0 xdebug.remote_enable=0
xdebug.cli_color=0 xdebug.cli_color=0
xdebug.profiler_enable=0 xdebug.profiler_enable=0
xdebug.profiler_output_dir="~/xdebug/phpstorm/tmp/profiling"
xdebug.profiler_output_dir=/tmp
xdebug.remote_handler=dbgp xdebug.remote_handler=dbgp
xdebug.remote_mode=req xdebug.remote_mode=req
@ -18,3 +18,6 @@ xdebug.var_display_max_children=-1
xdebug.var_display_max_data=-1 xdebug.var_display_max_data=-1
xdebug.var_display_max_depth=-1 xdebug.var_display_max_depth=-1
xdebug.trace_enable_trigger=1
xdebug.trace_output_dir=/tmp
xdebug.trace_output_name="trace.%t"
Loading…
Cancel
Save