lot of stuff on this commit, no commited docker environement since a while

This commit is contained in:
2022-07-26 23:08:23 +02:00
parent b60aa7fae1
commit c610a39441
15 changed files with 193 additions and 55 deletions

View File

@@ -1,16 +1,17 @@
FROM php:7.3-fpm
FROM php:7.4-fpm
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng-dev \
mysql-client \
default-mysql-client \
zip \
net-tools iproute2 \
libzip-dev && \
cp /usr/local/etc/php/php.ini-development /usr/local/etc/php/php.ini && \
# docker-php-ext-install -j$(nproc) iconv && \
docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ && \
apt-get install -y imagemagick libmagickwand-dev && \
pecl install imagick && docker-php-ext-enable imagick && \
docker-php-ext-install -j$(nproc) gd && \
@@ -19,7 +20,7 @@ RUN apt-get update && apt-get install -y \
docker-php-ext-install bcmath && \
apt-get install -y git vim && \
pecl install redis-4.3.0 && \
pecl install xdebug-2.7.0 && \
pecl install xdebug-3.1.3 && \
docker-php-ext-enable redis xdebug
RUN export COMPOSER_HOME=/usr/local/composer && \
@@ -32,12 +33,13 @@ RUN export COMPOSER_HOME=/usr/local/composer && \
-L -o /usr/local/bin/drush && \
chmod +x /usr/local/bin/drush
RUN apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_11.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
apt-get update && \
apt-get install -y nodejs yarn
# todo this is not building any more, do i really need this ? (22-10-2021)
# RUN apt-get install -y curl && \
# curl -sL https://deb.nodesource.com/setup_11.x | bash - && \
# curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
# echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
# apt-get update && \
# apt-get install -y nodejs yarn
RUN apt-get install -y rsyslog
COPY ./rsyslog-drupal.conf /etc/rsyslog.d/drupal.conf
@@ -46,8 +48,6 @@ COPY ./rsyslog-drupal.conf /etc/rsyslog.d/drupal.conf
COPY ./php-custom.ini /usr/local/etc/php/conf.d/php-custom.ini
# COPY ./php-fpm-custom.conf /usr/local/etc/php-fpm.d/php-fpm-custom.conf
# COPY ./bashrc /root/.bashrc
# COPY ./inputrc /root/.inputrc
ARG USER_UID
ARG USER_UNAME
@@ -57,6 +57,7 @@ ARG USER_GNAME
RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
groupadd -g ${USER_GID} ${USER_GNAME} &&\
useradd -l -u ${USER_UID} -g ${USER_GNAME} ${USER_UNAME} &&\
echo ${USER_UNAME}:${USER_UNAME} | chpasswd &&\
install -d -m 0755 -o ${USER_UNAME} -g ${USER_GNAME} /home/${USER_UNAME} &&\
chown --changes --silent --no-dereference --recursive \
--from=33:33 ${USER_UID}:${USER_GID} \
@@ -68,4 +69,23 @@ RUN if getent group ${USER_GNAME} ; then groupdel ${USER_GNAME}; fi &&\
COPY ./bashrc /home/${USER_UNAME}/.bashrc
COPY ./inputrc /home/${USER_UNAME}/.inputrc
USER ${USER_UNAME}
# https://dev.to/s1ntaxe770r/how-to-setup-ssh-within-a-docker-container-i5i
RUN apt-get install -y openssh-server openssh-client
# RUN service ssh enable
RUN service ssh start
# as sshd will be launchd as ${USER_UNAME}
RUN chown -R ${USER_UNAME} /etc/ssh
EXPOSE 22
# CMD ["/usr/sbin/sshd","-D"]
# https://stackoverflow.com/questions/36964652/ssh-in-docker-container-causes-http-404
# use \n to make the content into multiple lines
RUN printf "whoami\nphp-fpm -D\n/usr/sbin/sshd -D" >> /start.sh
RUN chmod +x /start.sh
CMD ["/start.sh"]
# USER ${USER_UNAME}

View File

@@ -1,4 +1,4 @@
PS1='\e[36m\e[1mPHP-7.3\e[0m:\e[90m\w\e[0m\n$ '
PS1='\e[36m\e[1mPHP-7.4\e[0m:\e[90m\w\e[0m\n$ '
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'