FROM ubuntu:18.04 ENV BOOT2DOCKER_ID 1000 ENV BOOT2DOCKER_GID 50 # Tweaks to give Apache/PHP write permissions to the app RUN usermod -u ${BOOT2DOCKER_ID} www-data && \ usermod -G staff www-data && \ useradd -r mysql && \ usermod -G staff mysql RUN groupmod -g $(($BOOT2DOCKER_GID + 10000)) $(getent group $BOOT2DOCKER_GID | cut -d: -f1) RUN groupmod -g ${BOOT2DOCKER_GID} staff # Install packages ENV DEBIAN_FRONTEND noninteractive RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ supervisor \ wget \ apache2 \ mariadb-server \ php \ php-xml \ php-mysql \ php-pdo \ php-gd \ php-intl \ php-mbstring \ php-zip \ libapache2-mod-php \ curl \ gnupg \ ca-certificates \ libgtk2.0-0 \ libgtk-3-0 \ libnotify-dev \ libgconf-2-4 \ libnss3 \ libxss1 \ libasound2 \ libxtst6 \ xauth \ xvfb \ jq; \ echo "ServerName localhost" >> /etc/apache2/apache2.conf; # Install yarn ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn RUN set -eux;\ apt-get update && apt-get install -y gnupg; \ 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 --no-install-recommends nodejs yarn; # Add image configuration and scripts ADD files/start-apache2.sh /start-apache2.sh ADD files/start-mysqld.sh /start-mysqld.sh ADD files/run.sh /run.sh RUN chmod 755 /*.sh ADD files/supervisord.conf /etc/supervisor/conf.d/supervisord.conf # Remove pre-installed database RUN rm -rf /var/lib/mysql # Add MySQL utils ADD files/create_mysql_users.sh /create_mysql_users.sh # Add composer RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \ php composer-setup.php && \ php -r "unlink('composer-setup.php');" && \ mv composer.phar /usr/local/bin/composer # config to enable .htaccess ADD files/apache_default /etc/apache2/sites-available/000-default.conf RUN a2enmod rewrite # Configure /app folder with sample app RUN mkdir -p /app && rm -fr /var/www/html && ln -s /app /var/www/html #Environment variables to configure php ENV PHP_UPLOAD_MAX_FILESIZE 10M ENV PHP_POST_MAX_SIZE 10M ENV PHP_VERSION 7.2 # Install Cypress RUN yarn global add --pure-lockfile cypress@4.11.0; WORKDIR /app CMD ["/run.sh"]