Browse Source

- remove php 73 containers

* remove nodejs install from src builds
* fix composer auth secret path links
master
dimti 2 years ago
parent
commit
fc044a1185
  1. 58
      dockerfiles/php-fpm/php73.Dockerfile
  2. 113
      dockerfiles/workspace/workspace73.Dockerfile
  3. 28
      dockerfiles/workspace/workspace74.Dockerfile
  4. 19
      dockerfiles/workspace/workspace81.Dockerfile
  5. 7
      src/docker-compose.base.yml
  6. 22
      src/docker-compose.yml
  7. 7
      src/dockerfiles/php-fpm/php73.Dockerfile
  8. 5
      src/dockerfiles/workspace/composer.Dockerfile
  9. 16
      src/dockerfiles/workspace/composer1.Dockerfile
  10. 0
      src/dockerfiles/workspace/tmux.conf
  11. 113
      src/dockerfiles/workspace/workspace.base.Dockerfile
  12. 9
      src/dockerfiles/workspace/workspace73.Dockerfile
  13. 2
      src/dockerfiles/workspace/workspace74.Dockerfile
  14. 2
      src/dockerfiles/workspace/workspace81.Dockerfile
  15. 0
      src/dockerfiles/workspace/xdebug2.ini

58
dockerfiles/php-fpm/php73.Dockerfile

@ -1,58 +0,0 @@
FROM dimti/php:7.3
###########################################################################
# 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 ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
###########################################################################
# Permission denied on /tmp folder:
###########################################################################
RUN chmod 1777 /tmp
###########################################################################
# 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"

113
dockerfiles/workspace/workspace73.Dockerfile

@ -1,113 +0,0 @@
FROM dimti/workspace:7.3
ARG PHP_VERSION=7.3
###########################################################################
# 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
###########################################################################
# Remove DST_Root_CA3
###########################################################################
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:
###########################################################################
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
###########################################################################
# Crontab
###########################################################################
USER root
COPY ./crontab /etc/cron.d
RUN chmod -R 644 /etc/cron.d

28
dockerfiles/workspace/workspace74.Dockerfile

@ -49,24 +49,19 @@ RUN composer self-update --${COMPOSER_VERSION}
USER root
ARG CUSTOM_NODE_VERSION
ENV CUSTOM_NODE_VERSION ${CUSTOM_NODE_VERSION}
ARG NODE_VERSION
ENV NODE_VERSION ${NODE_VERSION}
RUN if [ ! -z "${CUSTOM_NODE_VERSION}" ]; then \
. ~/.bashrc && nvm install ${CUSTOM_NODE_VERSION} \
&& . ~/.bashrc && nvm alias default ${CUSTOM_NODE_VERSION} \
RUN if [ ! -z "${NODE_VERSION}" ]; then \
. ~/.bashrc && nvm install ${NODE_VERSION} \
&& . ~/.bashrc && nvm alias default ${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 \
&& npm i -g yarn \
;fi
###########################################################################
# Remove DST_Root_CA3
###########################################################################
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
###########################################################################
@ -88,19 +83,12 @@ USER laradock
COPY ./minio/auth.json /home/laradock/.mc/config.json
###########################################################################
# Tmux and others temproray applications - must be moved into src build
# Clean up:
###########################################################################
USER root
RUN apt-get update -yqq && \
apt-get install -y tmux
COPY ./tmux.conf /etc/tmux.conf
# Clean up
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
###########################################################################
# Tune opts:

19
dockerfiles/workspace/workspace81.Dockerfile

@ -49,15 +49,16 @@ RUN composer self-update --${COMPOSER_VERSION}
USER root
ARG CUSTOM_NODE_VERSION
ENV CUSTOM_NODE_VERSION ${CUSTOM_NODE_VERSION}
ARG NODE_VERSION
ENV NODE_VERSION ${NODE_VERSION}
RUN if [ ! -z "${CUSTOM_NODE_VERSION}" ]; then \
. ~/.bashrc && nvm install ${CUSTOM_NODE_VERSION} \
&& . ~/.bashrc && nvm alias default ${CUSTOM_NODE_VERSION} \
RUN if [ ! -z "${NODE_VERSION}" ]; then \
. ~/.bashrc && nvm install ${NODE_VERSION} \
&& . ~/.bashrc && nvm alias default ${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 \
&& npm i -g yarn \
;fi
###########################################################################
@ -82,6 +83,14 @@ USER laradock
COPY ./minio/auth.json /home/laradock/.mc/config.json
###########################################################################
# Clean up:
###########################################################################
USER root
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
###########################################################################
# Tune opts:
###########################################################################

7
src/docker-compose.base.yml

@ -28,15 +28,8 @@ services:
- INSTALL_FSWATCH=${WORKSPACE_INSTALL_FSWATCH}
- INSTALL_PING=${WORKSPACE_INSTALL_PING}
- INSTALL_S3_MINIO_CLIENT=${WORKSPACE_INSTALL_S3_MINIO_CLIENT}
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
- INSTALL_BZ2=${WORKSPACE_INSTALL_BZ2}
- INSTALL_WP_CLI=${WORKSPACE_INSTALL_WP_CLI}
- INSTALL_NODE=${WORKSPACE_INSTALL_NODE}
- INSTALL_GULP=${WORKSPACE_INSTALL_GULP}
- INSTALL_YARN=${WORKSPACE_INSTALL_YARN}
- NODE_VERSION=${WORKSPACE_NODE_VERSION}
- NPM_REGISTRY=${WORKSPACE_NPM_REGISTRY}
- 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}

22
src/docker-compose.yml

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

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

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

5
src/dockerfiles/workspace/composer2.Dockerfile → src/dockerfiles/workspace/composer.Dockerfile

@ -10,7 +10,4 @@ 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
RUN ln -s /run/secrets/composer_auth /home/laradock/.config/composer/auth.json

16
src/dockerfiles/workspace/composer1.Dockerfile

@ -1,16 +0,0 @@
###########################################################################
# 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

0
dockerfiles/workspace/tmux.conf → src/dockerfiles/workspace/tmux.conf

113
src/dockerfiles/workspace/workspace.base.Dockerfile

@ -212,131 +212,36 @@ RUN if [ ${INSTALL_WP_CLI} = true ]; then \
USER laradock
# Check if NVM needs to be installed
ARG INSTALL_NODE=false
ENV INSTALL_NODE ${INSTALL_NODE}
ARG NODE_VERSION=node
ENV NODE_VERSION ${NODE_VERSION}
ARG INSTALL_NPM_GULP=false
ARG INSTALL_NPM_BOWER=false
ARG INSTALL_NPM_VUE_CLI=false
ARG INSTALL_NPM_ANGULAR_CLI=false
ARG NPM_REGISTRY
ENV NPM_REGISTRY ${NPM_REGISTRY}
ENV NVM_DIR /home/laradock/.nvm
RUN if [ ${INSTALL_NODE} = true ]; then \
# Install nvm (A Node Version Manager)
mkdir -p $NVM_DIR && \
RUN mkdir -p $NVM_DIR && \
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install ${NODE_VERSION} \
&& nvm use ${NODE_VERSION} \
&& nvm alias ${NODE_VERSION} \
&& if [ ${NPM_REGISTRY} ]; then \
npm config set registry ${NPM_REGISTRY} \
;fi \
&& if [ ${INSTALL_NPM_GULP} = true ]; then \
npm install -g gulp \
;fi \
&& if [ ${INSTALL_NPM_BOWER} = true ]; then \
npm install -g bower \
;fi \
&& if [ ${INSTALL_NPM_VUE_CLI} = true ]; then \
npm install -g @vue/cli \
;fi \
&& if [ ${INSTALL_NPM_ANGULAR_CLI} = true ]; then \
npm install -g @angular/cli \
;fi \
&& ln -s `npm bin --global` /home/laradock/.node-bin \
;fi
&& . $NVM_DIR/nvm.sh
# Wouldn't execute when added to the RUN statement in the above block
# Source NVM when loading bash since ~/.profile isn't loaded on non-login shell
RUN if [ ${INSTALL_NODE} = true ]; then \
echo "" >> ~/.bashrc && \
RUN echo "" >> ~/.bashrc && \
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
;fi
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc
# Add NVM binaries to root's .bashrc
USER root
RUN if [ ${INSTALL_NODE} = true ]; then \
cp -R /home/laradock/.nvm /root/ && \
RUN cp -R /home/laradock/.nvm /root/ && \
chown -R root:root /root/.nvm && \
echo "" >> ~/.bashrc && \
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
;fi
# Add PATH for node
ENV PATH $PATH:/home/laradock/.node-bin
# Make it so the node modules can be executed with 'docker-compose exec'
# We'll create symbolic links into '/usr/local/bin'.
RUN if [ ${INSTALL_NODE} = true ]; then \
find $NVM_DIR -type f -name node -exec ln -s {} /usr/local/bin/node \; && \
NODE_MODS_DIR="$NVM_DIR/versions/node/$(node -v)/lib/node_modules" && \
ln -s $NODE_MODS_DIR/bower/bin/bower /usr/local/bin/bower && \
ln -s $NODE_MODS_DIR/gulp/bin/gulp.js /usr/local/bin/gulp && \
ln -s $NODE_MODS_DIR/npm/bin/npm-cli.js /usr/local/bin/npm && \
ln -s $NODE_MODS_DIR/npm/bin/npx-cli.js /usr/local/bin/npx && \
ln -s $NODE_MODS_DIR/vue-cli/bin/vue /usr/local/bin/vue && \
ln -s $NODE_MODS_DIR/vue-cli/bin/vue-init /usr/local/bin/vue-init && \
ln -s $NODE_MODS_DIR/vue-cli/bin/vue-list /usr/local/bin/vue-list \
;fi
RUN if [ ${NPM_REGISTRY} ]; then \
. ~/.bashrc && npm config set registry ${NPM_REGISTRY} \
;fi
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc
###########################################################################
# GULP:
# Tmux
###########################################################################
ARG INSTALL_GULP=false
ENV INSTALL_GULP ${INSTALL_GULP}
USER root
RUN if [ ${INSTALL_GULP} = true ]; then \
npm i -g gulp gulp-cli \
;fi
###########################################################################
# YARN:
###########################################################################
USER laradock
ARG INSTALL_YARN=false
ENV INSTALL_YARN ${INSTALL_YARN}
ARG YARN_VERSION=latest
ENV YARN_VERSION ${YARN_VERSION}
RUN if [ ${INSTALL_YARN} = true ]; then \
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
if [ ${YARN_VERSION} = "latest" ]; then \
curl -o- -L https://yarnpkg.com/install.sh | bash; \
else \
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \
fi && \
echo "" >> ~/.bashrc && \
echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \
;fi
# Add YARN binaries to root's .bashrc
USER root
RUN if [ ${INSTALL_YARN} = true ]; then \
echo "" >> ~/.bashrc && \
echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc && \
echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \
;fi
RUN apt-get update -yqq && apt-get install -y tmux
# Add PATH for YARN
ENV PATH $PATH:/home/laradock/.yarn/bin
COPY ./tmux.conf /etc/tmux.conf
###########################################################################
# Remove DST_Root_CA3

9
src/dockerfiles/workspace/workspace73.Dockerfile

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

2
src/dockerfiles/workspace/workspace74.Dockerfile

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

2
src/dockerfiles/workspace/workspace81.Dockerfile

@ -5,5 +5,5 @@ ARG PHP_VERSION=8.1
ENV PHP_VERSION ${PHP_VERSION}
INCLUDE+ ./workspace.base.Dockerfile
INCLUDE+ ./composer2.Dockerfile
INCLUDE+ ./composer.Dockerfile
INCLUDE+ ./xdebug3.Dockerfile

0
src/dockerfiles/workspace/xdebug.ini → src/dockerfiles/workspace/xdebug2.ini

Loading…
Cancel
Save