+ php src container fully refactored and lightweight
* on host system container also refactored, some env options moved from .env to docker-compose example * dnsmasq now is separate service file + php 8.3 support * xdebug launch also refactored and lightweight * tested and worked python environment with pyenv (on today without supervisor) * database container and appropriate gui applications for management database systems moved into separate service files + build src php container helper - remove unnecessary docker compose file version directive - remove minio thing from the host php services * use redis-local.conf from example and lightweight main redis conf file
This commit is contained in:
@ -1,171 +1,7 @@
|
||||
# syntax = edrevo/dockerfile-plus
|
||||
FROM dimti/workspace:7.4
|
||||
|
||||
ARG PHP_VERSION=7.4
|
||||
ENV PHP_VERSION ${PHP_VERSION}
|
||||
|
||||
###########################################################################
|
||||
# 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
|
||||
|
||||
###########################################################################
|
||||
# S3 config
|
||||
###########################################################################
|
||||
|
||||
USER laradock
|
||||
|
||||
COPY ./minio/auth.json /home/laradock/.mc/config.json
|
||||
|
||||
###########################################################################
|
||||
# Install custom node version
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG NODE_VERSION
|
||||
ENV NODE_VERSION ${NODE_VERSION}
|
||||
|
||||
RUN if [ ! -z "${NODE_VERSION}" ]; then \
|
||||
. ~/.bashrc && nvm install ${NODE_VERSION} \
|
||||
&& . ~/.bashrc && nvm alias default ${NODE_VERSION} \
|
||||
&& npm i -g yarn \
|
||||
&& cp -R ~/.nvm/alias /home/laradock/.nvm \
|
||||
&& cp -R ~/.nvm/versions /home/laradock/.nvm \
|
||||
&& chown -R ${CUSTOM_PUID}:${CUSTOM_PGID} /home/laradock/.nvm \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Update composer version
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG COMPOSER_VERSION=1
|
||||
ENV COMPOSER_VERSION ${COMPOSER_VERSION}
|
||||
RUN composer self-update # Need for correctly update to actual old branch
|
||||
RUN composer self-update --${COMPOSER_VERSION}
|
||||
|
||||
###########################################################################
|
||||
# YADM
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
SHELL ["/bin/bash", "-c"]
|
||||
|
||||
# once please
|
||||
RUN apt update
|
||||
|
||||
RUN apt install -y direnv yadm
|
||||
RUN curl -sS https://starship.rs/install.sh | sh -s -- -f
|
||||
|
||||
USER laradock
|
||||
|
||||
RUN yadm clone --bootstrap https://vcs.wpstudio.ru/gitea/dotfiles.git
|
||||
|
||||
RUN sed -i 's/#/\\$/g' ${HOME}/.config/starship.toml
|
||||
|
||||
###########################################################################
|
||||
# SUPERVISOR:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_SUPERVISOR=false
|
||||
|
||||
RUN if [ ${INSTALL_SUPERVISOR} = true ]; then \
|
||||
apt install -y supervisor \
|
||||
;fi
|
||||
|
||||
RUN apt install -y liblzma-dev libbz2-dev libffi-dev libreadline-dev
|
||||
|
||||
USER laradock
|
||||
|
||||
RUN curl https://pyenv.run | bash
|
||||
|
||||
RUN echo '' >> ~/.shell-env.local && \
|
||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.shell-env.local && \
|
||||
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.shell-env.local && \
|
||||
echo 'eval "$(pyenv init -)"' >> ~/.shell-env.local && \
|
||||
echo '' >> ~/.shell-env.local && \
|
||||
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.shell-env.local && \
|
||||
echo '' >> ~/.shell-env.local
|
||||
|
||||
RUN $HOME/.pyenv/bin/pyenv install 3.9
|
||||
|
||||
ARG INSTALL_PYTHON=false
|
||||
|
||||
RUN if [ ${INSTALL_PYTHON} = true ]; then \
|
||||
export PYENV_VERSION=3.9 && \
|
||||
python -m pip install uvicorn \
|
||||
;fi
|
||||
|
||||
RUN if [ false = true ]; then \
|
||||
export PYENV_VERSION=3.9 && \
|
||||
python -m pip install uvicorn && \
|
||||
python -m pip install --upgrade supervisor && \
|
||||
echo_supervisord_conf > /etc/supervisord.conf && \
|
||||
sed -i 's/\;\[include\]/\[include\]/g' /etc/supervisord.conf && \
|
||||
sed -i 's/\;files\s.*/files = supervisord.d\/*.conf/g' /etc/supervisord.conf \
|
||||
;fi
|
||||
|
||||
USER root
|
||||
|
||||
RUN apt install -y htop
|
||||
|
||||
###########################################################################
|
||||
# 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
|
||||
|
||||
# Clean up
|
||||
RUN apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
COPY ./crontab /etc/cron.d
|
||||
|
||||
RUN chmod -R 644 /etc/cron.d
|
||||
|
||||
|
||||
#ENTRYPOINT ["/bin/bash","-c","service supervisor start"]
|
||||
INCLUDE+ ./workspace.base.Dockerfile
|
||||
|
Reference in New Issue
Block a user