|
| 1 | +# dockerized drupal development box |
| 2 | +# includes apache, php, xhprof, imagemagick, sshd and drush |
| 3 | +# No mysql, use a dedicated mysql-docker-image and link the container. |
| 4 | +# |
| 5 | +# VERSION php-84 |
| 6 | +# DOCKER-VERSION 2 |
| 7 | +FROM debian:bookworm |
| 8 | +LABEL org.opencontainers.image.authors=" [email protected]" |
| 9 | + |
| 10 | +RUN dpkg-divert --local --rename --add /sbin/initctl |
| 11 | +RUN ln -sf /bin/true /sbin/initctl |
| 12 | + |
| 13 | +RUN export DEBIAN_FRONTEND=noninteractive && apt-get update --fix-missing && apt-get -y -q install git default-mysql-client wget optipng pngquant webp jpegoptim apt-transport-https lsb-release ca-certificates sqlite3 |
| 14 | + |
| 15 | +# Prepare php8.1 |
| 16 | +RUN /usr/bin/wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg |
| 17 | +RUN echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list |
| 18 | + |
| 19 | +RUN export DEBIAN_FRONTEND=noninteractive && apt-get update --fix-missing && apt-get -y -q install rsync unzip apache2 pwgen python3-pip vim-tiny openssh-server cron vim curl graphviz make imagemagick libapache2-mod-php8.4 php8.4-mysql php8.4-curl php8.4-memcache php8.4-redis php8.4-mbstring php8.4-zip php8.4-gd php8.4-dom php8.4-xml php8.4-bcmath php8.4-soap php8.4-sqlite3 php8.4-apcu php8.4-intl |
| 20 | + |
| 21 | +# composer and drush |
| 22 | +RUN curl -ss https://getcomposer.org/installer | php |
| 23 | +RUN mv composer.phar /usr/local/bin/composer |
| 24 | +RUN mkdir -p /.cache && chmod -R 777 /.cache |
| 25 | +RUN /usr/local/bin/composer global require "drush/drush" |
| 26 | +RUN sed -i '1i export PATH="$HOME/.config/composer/vendor/bin:$PATH"' /root/.bashrc |
| 27 | + |
| 28 | + |
| 29 | +# sshd |
| 30 | +RUN DEBIAN_FRONTEND=noninteractive apt-get autoclean |
| 31 | +RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config |
| 32 | +RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config |
| 33 | +RUN sed -ri 's/#UsePAM no/UsePAM no/g' /etc/ssh/sshd_config |
| 34 | +RUN mkdir /var/run/sshd |
| 35 | +RUN echo 'root:root' |chpasswd |
| 36 | + |
| 37 | +# configure apache |
| 38 | +RUN sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf |
| 39 | +RUN a2enmod rewrite vhost_alias |
| 40 | + |
| 41 | +RUN pip3 install supervisor --break-system-packages |
| 42 | +ADD ./common/start.sh /start.sh |
| 43 | +ADD ./common/foreground.sh /etc/apache2/foreground.sh |
| 44 | +ADD ./common/apache-vhost.conf /etc/apache2/sites-available/000-default.conf |
| 45 | +ADD ./common/supervisord.conf /etc/supervisord.conf |
| 46 | +ADD ./php-84/php.ini /etc/php/8.4/apache2/php.ini |
| 47 | +ADD ./php-84/php_cli.ini /etc/php/8.4/cli/php.ini |
| 48 | +ADD ./php-84/phpsendmail /usr/local/bin/phpsendmail |
| 49 | +RUN chmod +x /usr/local/bin/phpsendmail |
| 50 | +RUN touch /var/log/mail_php.log |
| 51 | +RUN chmod 777 /var/log/mail_php.log |
| 52 | +RUN touch /var/log/php_errors.log |
| 53 | +RUN chmod 777 /var/log/php_errors.log |
| 54 | + |
| 55 | +RUN chmod 755 /start.sh /etc/apache2/foreground.sh |
| 56 | +EXPOSE 80 |
| 57 | +CMD ["/bin/bash", "/start.sh"] |
0 commit comments