Browse Source

+ php 8.1

* refactoring composer version & auth secrets apply separate for workspaces
master
dimti 2 years ago
parent
commit
c3d132b120
  1. 6
      docker-compose.base.yml
  2. 24
      docker-compose.yml.example
  3. 52
      dockerfiles/php-fpm/php81.Dockerfile
  4. 0
      dockerfiles/php-fpm/xdebug2/xdebug.ini
  5. 0
      dockerfiles/php-fpm/xdebug2/xdebug.sh
  6. 26
      dockerfiles/php-fpm/xdebug3/xdebug.ini
  7. 87
      dockerfiles/php-fpm/xdebug3/xdebug.sh
  8. 1
      dockerfiles/workspace/.gitignore
  9. 0
      dockerfiles/workspace/crontab-example/laradock
  10. 0
      dockerfiles/workspace/laradock.example
  11. 2
      dockerfiles/workspace/workspace73.Dockerfile
  12. 2
      dockerfiles/workspace/workspace74.Dockerfile
  13. 113
      dockerfiles/workspace/workspace81.Dockerfile
  14. 14
      get-composer-auth.sh
  15. 5
      src/.env
  16. 3
      src/docker-compose.base.yml
  17. 16
      src/docker-compose.yml
  18. 2
      src/dockerfiles/php-fpm/php.base.Dockerfile
  19. 7
      src/dockerfiles/php-fpm/php81.Dockerfile
  20. 5
      src/dockerfiles/workspace/composer.json
  21. 16
      src/dockerfiles/workspace/composer1.Dockerfile
  22. 16
      src/dockerfiles/workspace/composer2.Dockerfile
  23. 53
      src/dockerfiles/workspace/workspace.base.Dockerfile
  24. 1
      src/dockerfiles/workspace/workspace73.Dockerfile
  25. 1
      src/dockerfiles/workspace/workspace74.Dockerfile
  26. 8
      src/dockerfiles/workspace/workspace81.Dockerfile

6
docker-compose.base.yml

@ -53,7 +53,7 @@ services:
secrets: secrets:
- user_ssh_key - user_ssh_key
- user_known_hosts - user_known_hosts
- composer_auth
- composer_auth2
inbucket: inbucket:
image: inbucket/inbucket image: inbucket/inbucket
restart: always restart: always
@ -92,5 +92,7 @@ secrets:
file: ~/.ssh/id_rsa file: ~/.ssh/id_rsa
user_known_hosts: user_known_hosts:
file: ~/.ssh/known_hosts file: ~/.ssh/known_hosts
composer_auth:
composer1_auth:
file: ~/.composer/auth.json
composer2_auth:
file: ~/.config/composer/auth.json file: ~/.config/composer/auth.json

24
docker-compose.yml.example

@ -21,18 +21,38 @@ services:
service: php service: php
build: build:
dockerfile: php74.Dockerfile dockerfile: php74.Dockerfile
php81:
extends:
file: docker-compose.base.yml
service: php
build:
dockerfile: php81.Dockerfile
workspace73: workspace73:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
service: workspace service: workspace
build: build:
dockerfile: workspace73.Dockerfile dockerfile: workspace73.Dockerfile
secrets:
- user_ssh_key
- user_known_hosts
- composer_auth1
workspace74: workspace74:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
service: workspace service: workspace
build: build:
dockerfile: workspace74.Dockerfile dockerfile: workspace74.Dockerfile
secrets:
- user_ssh_key
- user_known_hosts
- composer_auth1
workspace81:
extends:
file: docker-compose.base.yml
service: workspace
build:
dockerfile: workspace81.Dockerfile
inbucket: inbucket:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
@ -65,7 +85,7 @@ secrets:
file: ~/.ssh/id_rsa file: ~/.ssh/id_rsa
user_known_hosts: user_known_hosts:
file: ~/.ssh/known_hosts file: ~/.ssh/known_hosts
composer_auth1:
composer1_auth:
file: ~/.composer/auth.json file: ~/.composer/auth.json
composer_auth2:
composer2_auth:
file: ~/.config/composer/auth.json file: ~/.config/composer/auth.json

52
dockerfiles/php-fpm/php81.Dockerfile

@ -0,0 +1,52 @@
FROM dimti/php:8.1
###########################################################################
# Redis and igbinary:
###########################################################################
ARG INSTALL_REDIS=false
COPY ./igbinary.ini /usr/local/etc/php/conf.d/igbinary.ini
RUN if [ ${INSTALL_REDIS} = true ]; then \
pecl install -a igbinary \
&& docker-php-ext-enable igbinary \
&& printf "yes\n" | pecl install redis \
&& docker-php-ext-enable redis \
;fi
###########################################################################
# Pear Mail and Mail_Mime:
###########################################################################
ARG INSTALL_PEAR_MAIL=false
RUN if [ ${INSTALL_PEAR_MAIL} = true ]; then \
pear install Mail && pear install Mail_Mime \
;fi
###########################################################################
# xDebug (termporary):
###########################################################################
# Copy xdebug configuration for remote debugging
COPY ./xdebug3/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
###########################################################################
# 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=600
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=256M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini"
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"

0
dockerfiles/php-fpm/xdebug.ini → dockerfiles/php-fpm/xdebug2/xdebug.ini

0
dockerfiles/php-fpm/xdebug.sh → dockerfiles/php-fpm/xdebug2/xdebug.sh

26
dockerfiles/php-fpm/xdebug3/xdebug.ini

@ -0,0 +1,26 @@
; 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_connect_back=1
xdebug.remote_port=9000
xdebug.idekey=PHPSTORM
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.cli_color=0
xdebug.profiler_enable=1
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=/tmp/profiler
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.var_display_max_children=-1
xdebug.var_display_max_data=-1
xdebug.var_display_max_depth=-1
xdebug.trace_enable_trigger=1
xdebug.trace_output_dir=/tmp/trace
xdebug.trace_output_name="trace.%t"
xdebug.show_exception_trace=1

87
dockerfiles/php-fpm/xdebug3/xdebug.sh

@ -0,0 +1,87 @@
#! /bin/bash
# NOTE: At the moment, this has only been confirmed to work with PHP 7
PHP_VERSION=$2 # Without dot
WITH_PROFILER=$3
# Grab full name of php-fpm container
PHP_FPM_CONTAINER=$(docker ps | grep php${PHP_VERSION} | awk '{print $1}')
if [[ -z "${PHP_FPM_CONTAINER}" ]]; then
echo "Unable to find php fpm container: php${PHP_VERSION}"
exit 1
fi
if [[ ! -z "${WITH_PROFILER}" ]]; then
echo "With profiler option".
fi
xdebug_status ()
{
echo 'xDebug status'
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
}
xdebug_start ()
{
echo 'Start xDebug'
# 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"
REMOTE_AUTOSTART_CMD="sed -i 's/^xdebug.remote_autostart=0/xdebug.remote_autostart=1/g' /usr/local/etc/php/conf.d/xdebug.ini"
REMOTE_ENABLE_CMD="sed -i 's/^xdebug.remote_enable=0/xdebug.remote_enable=1/g' /usr/local/etc/php/conf.d/xdebug.ini"
PROFILER_ENABLE_CDM="sed -i 's/^xdebug.profiler_enable=0/xdebug.profiler_enable=1/g' /usr/local/etc/php/conf.d/xdebug.ini"
docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
if [[ ! -z "${WITH_PROFILER}" ]]; then
docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_ENABLE_CDM}"
fi
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
}
xdebug_stop ()
{
echo 'Stop xDebug'
# 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"
REMOTE_AUTOSTART_CMD="sed -i 's/^xdebug.remote_autostart=1/xdebug.remote_autostart=0/g' /usr/local/etc/php/conf.d/xdebug.ini"
REMOTE_ENABLE_CMD="sed -i 's/^xdebug.remote_enable=1/xdebug.remote_enable=0/g' /usr/local/etc/php/conf.d/xdebug.ini"
PROFILER_DISABLE_CMD="sed -i 's/^xdebug.profiler_enable=1/xdebug.profiler_enable=0/g' /usr/local/etc/php/conf.d/xdebug.ini"
docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_DISABLE_CMD}"
# docker-compose restart php-fpm
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
}
case $1 in
stop|STOP)
xdebug_stop
;;
start|START)
xdebug_start
;;
status|STATUS)
xdebug_status
;;
*)
echo "xDebug [Stop | Start | Status] in the ${PHP_FPM_CONTAINER} container."
echo "xDebug must have already been installed."
echo "Usage:"
echo " .php-fpm/xdebug.sh 73|74 stop|start|status"
esac
exit 1

1
dockerfiles/workspace/.gitignore

@ -1 +1,2 @@
/aliases.sh /aliases.sh
/crontab

0
dockerfiles/workspace/crontab73/laradock → dockerfiles/workspace/crontab-example/laradock

0
dockerfiles/workspace/crontab74/laradock → dockerfiles/workspace/laradock.example

2
dockerfiles/workspace/workspace73.Dockerfile

@ -114,6 +114,6 @@ RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MA
USER root USER root
COPY ./crontab73 /etc/cron.d
COPY ./crontab /etc/cron.d
RUN chmod -R 644 /etc/cron.d RUN chmod -R 644 /etc/cron.d

2
dockerfiles/workspace/workspace74.Dockerfile

@ -114,6 +114,6 @@ RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MA
USER root USER root
COPY ./crontab74 /etc/cron.d
COPY ./crontab /etc/cron.d
RUN chmod -R 644 /etc/cron.d RUN chmod -R 644 /etc/cron.d

113
dockerfiles/workspace/workspace81.Dockerfile

@ -0,0 +1,113 @@
FROM dimti/workspace:8.1
ARG PHP_VERSION=8.1
###########################################################################
# Laradock non-root user:
###########################################################################
ARG CUSTOM_PUID=1000
ENV PUID ${CUSTOM_PUID}
ARG CUSTOM_PGID=1000
ENV PGID ${CUSTOM_PGID}
RUN usermod -u ${CUSTOM_PUID} laradock && groupmod -g ${CUSTOM_PGID} laradock
RUN chown -R ${CUSTOM_PUID}:${CUSTOM_PGID} /home/laradock
###########################################################################
# Set Timezone
###########################################################################
ARG CUSTOM_TZ=Europe/Moscow
ENV TZ ${CUSTOM_TZ}
RUN ln -snf /usr/share/zoneinfo/$CUSTOM_TZ /etc/localtime && echo $CUSTOM_TZ > /etc/timezone
###########################################################################
# Additional PHP-extensions:
###########################################################################
#RUN pecl install igbinary && pecl install -a redis
RUN pecl install -a redis
RUN echo "extension=redis.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-redis.ini
###########################################################################
# Update composer version
###########################################################################
USER root
ARG COMPOSER_VERSION=2
ENV COMPOSER_VERSION ${COMPOSER_VERSION}
RUN composer self-update --${COMPOSER_VERSION}
###########################################################################
# Install custom node version
###########################################################################
USER root
ARG CUSTOM_NODE_VERSION
ENV CUSTOM_NODE_VERSION ${CUSTOM_NODE_VERSION}
RUN if [ ! -z "${CUSTOM_NODE_VERSION}" ]; then \
. ~/.bashrc && nvm install ${CUSTOM_NODE_VERSION} \
&& . ~/.bashrc && nvm alias default ${CUSTOM_NODE_VERSION} \
&& cp -R ~/.nvm/alias /home/laradock/.nvm \
&& cp -R ~/.nvm/versions /home/laradock/.nvm \
&& chown -R ${CUSTOM_PUID}:${CUSTOM_PGID} /home/laradock/.nvm \
;fi
###########################################################################
# 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:
###########################################################################
USER root
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
###########################################################################
USER root
COPY ./crontab /etc/cron.d
RUN chmod -R 644 /etc/cron.d

14
get-composer-auth.sh

@ -1,11 +1,11 @@
#!/bin/bash #!/bin/bash
FILE=${HOME}/.config/composer/auth.json
if [[ -f "${FILE}" ]]; then
if [[ ! -z "$(cat $FILE | grep github)" ]]; then
exit 0
fi
fi
#FILE=${HOME}/.config/composer/auth.json
#
#if [[ -f "${FILE}" ]]; then
# if [[ ! -z "$(cat $FILE | grep github)" ]]; then
# exit 0
# fi
#fi
echo "Get token: https://github.com/settings/tokens/new?scopes=repo&description=Composer" echo "Get token: https://github.com/settings/tokens/new?scopes=repo&description=Composer"

5
src/.env

@ -14,10 +14,7 @@ WORKSPACE_INSTALL_WP_CLI=true
WORKSPACE_INSTALL_NODE=true WORKSPACE_INSTALL_NODE=true
WORKSPACE_INSTALL_GULP=true WORKSPACE_INSTALL_GULP=true
WORKSPACE_INSTALL_YARN=true WORKSPACE_INSTALL_YARN=true
WORKSPACE_COMPOSER_VERSION=1
WORKSPACE_COMPOSER_GLOBAL_INSTALL=true
WORKSPACE_COMPOSER_REPO_PACKAGIST=
WORKSPACE_NODE_VERSION=lts/dubnium
WORKSPACE_NODE_VERSION=lts/hydrogen
WORKSPACE_NPM_REGISTRY= WORKSPACE_NPM_REGISTRY=
WORKSPACE_YARN_VERSION=latest WORKSPACE_YARN_VERSION=latest

3
src/docker-compose.base.yml

@ -30,9 +30,6 @@ services:
- INSTALL_S3_MINIO_CLIENT=${WORKSPACE_INSTALL_S3_MINIO_CLIENT} - INSTALL_S3_MINIO_CLIENT=${WORKSPACE_INSTALL_S3_MINIO_CLIENT}
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG} - INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
- INSTALL_BZ2=${WORKSPACE_INSTALL_BZ2} - INSTALL_BZ2=${WORKSPACE_INSTALL_BZ2}
- COMPOSER_VERSION=${WORKSPACE_COMPOSER_VERSION}
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
- COMPOSER_REPO_PACKAGIST=${WORKSPACE_COMPOSER_REPO_PACKAGIST}
- INSTALL_WP_CLI=${WORKSPACE_INSTALL_WP_CLI} - INSTALL_WP_CLI=${WORKSPACE_INSTALL_WP_CLI}
- INSTALL_NODE=${WORKSPACE_INSTALL_NODE} - INSTALL_NODE=${WORKSPACE_INSTALL_NODE}
- INSTALL_GULP=${WORKSPACE_INSTALL_GULP} - INSTALL_GULP=${WORKSPACE_INSTALL_GULP}

16
src/docker-compose.yml

@ -19,6 +19,12 @@ services:
service: php-fpm service: php-fpm
build: build:
dockerfile: php74.Dockerfile dockerfile: php74.Dockerfile
php81:
extends:
file: docker-compose.base.yml
service: php-fpm
build:
dockerfile: php81.Dockerfile
workspace73: workspace73:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
@ -31,11 +37,19 @@ services:
service: workspace service: workspace
build: build:
dockerfile: workspace74.Dockerfile dockerfile: workspace74.Dockerfile
workspace81:
extends:
file: docker-compose.base.yml
service: workspace
build:
dockerfile: workspace81.Dockerfile
secrets: secrets:
user_ssh_key: user_ssh_key:
file: ~/.ssh/id_rsa file: ~/.ssh/id_rsa
user_known_hosts: user_known_hosts:
file: ~/.ssh/known_hosts file: ~/.ssh/known_hosts
composer_auth:
composer1_auth:
file: ~/.composer/auth.json file: ~/.composer/auth.json
composer2_auth:
file: ~/.config/composer/auth.json

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

@ -23,6 +23,8 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Install the xdebug extension # Install the xdebug extension
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install xdebug-2.5.5; \ pecl install xdebug-2.5.5; \
elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
pecl install xdebug-3.1.6; \
else \ else \
pecl install xdebug-2.9.8; \ pecl install xdebug-2.9.8; \
fi && \ fi && \

7
src/dockerfiles/php-fpm/php81.Dockerfile

@ -0,0 +1,7 @@
# syntax = edrevo/dockerfile-plus
FROM php:8.1-fpm
INCLUDE+ ./php.base.Dockerfile
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) gd

5
src/dockerfiles/workspace/composer.json

@ -1,5 +0,0 @@
{
"require": {
}
}

16
src/dockerfiles/workspace/composer1.Dockerfile

@ -0,0 +1,16 @@
###########################################################################
# Composer:
###########################################################################
USER laradock
# Create composer dir for store composer2_auth secret
RUN mkdir -p /home/laradock/.composer
USER root
# Symlink to composer auth secret
RUN ln -s /run/secrets/composer1_auth /home/laradock/.composer/auth.json
# Chooce composer version
RUN composer self-update --1

16
src/dockerfiles/workspace/composer2.Dockerfile

@ -0,0 +1,16 @@
###########################################################################
# Composer:
###########################################################################
USER laradock
# Create composer dir for store composer2_auth secret
RUN mkdir -p /home/laradock/.config/composer
USER root
# Symlink to composer auth secret
RUN ln -s /run/secrets/composer2_auth /home/laradock/.config/composer/auth.json
# Chooce composer version
RUN composer self-update --2

53
src/dockerfiles/workspace/workspace.base.Dockerfile

@ -176,7 +176,13 @@ COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
ARG INSTALL_XDEBUG=false ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
pecl install xdebug-2.8.1 && \
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
pecl install xdebug-2.5.5; \
elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
pecl install xdebug-3.1.6; \
else \
pecl install xdebug-2.9.8; \
fi && \
echo ';zend_extension=xdebug.so' > /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \ echo ';zend_extension=xdebug.so' > /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \ echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \
;fi ;fi
@ -192,51 +198,6 @@ RUN if [ ${INSTALL_BZ2} = true ]; then \
;fi ;fi
########################################################################### ###########################################################################
# Composer:
###########################################################################
USER root
# Add the composer.json
COPY ./composer.json /home/laradock/.composer/composer.json
# Make sure that ~/.composer belongs to laradock
RUN chown -R laradock:laradock /home/laradock/.composer
RUN ln -s /run/secrets/composer_auth /home/laradock/.composer/auth.json
# Export composer vendor path
RUN echo "" >> ~/.bashrc && \
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> ~/.bashrc
# Update composer
ARG COMPOSER_VERSION=2
ENV COMPOSER_VERSION ${COMPOSER_VERSION}
RUN composer self-update --${COMPOSER_VERSION}
USER laradock
# Check if global install need to be ran
ARG COMPOSER_GLOBAL_INSTALL=false
ENV COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
# run the install
composer global install \
;fi
ARG COMPOSER_REPO_PACKAGIST
ENV COMPOSER_REPO_PACKAGIST ${COMPOSER_REPO_PACKAGIST}
RUN if [ ${COMPOSER_REPO_PACKAGIST} ]; then \
composer config -g repo.packagist composer ${COMPOSER_REPO_PACKAGIST} \
;fi
# Export composer vendor path
RUN echo "" >> ~/.bashrc && \
echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc
###########################################################################
# Non-root user : PHPUnit path # Non-root user : PHPUnit path
########################################################################### ###########################################################################

1
src/dockerfiles/workspace/workspace73.Dockerfile

@ -5,3 +5,4 @@ ARG PHP_VERSION=7.3
ENV PHP_VERSION ${PHP_VERSION} ENV PHP_VERSION ${PHP_VERSION}
INCLUDE+ ./workspace.base.Dockerfile INCLUDE+ ./workspace.base.Dockerfile
INCLUDE+ ./composer1.Dockerfile

1
src/dockerfiles/workspace/workspace74.Dockerfile

@ -5,3 +5,4 @@ ARG PHP_VERSION=7.4
ENV PHP_VERSION ${PHP_VERSION} ENV PHP_VERSION ${PHP_VERSION}
INCLUDE+ ./workspace.base.Dockerfile INCLUDE+ ./workspace.base.Dockerfile
INCLUDE+ ./composer1.Dockerfile

8
src/dockerfiles/workspace/workspace81.Dockerfile

@ -0,0 +1,8 @@
# syntax = edrevo/dockerfile-plus
FROM laradock/workspace:latest-8.1
ARG PHP_VERSION=8.1
ENV PHP_VERSION ${PHP_VERSION}
INCLUDE+ ./workspace.base.Dockerfile
INCLUDE+ ./composer2.Dockerfile
Loading…
Cancel
Save