Skip to content

Commit

Permalink
update docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelthq committed Oct 20, 2022
1 parent d003025 commit 50cc96c
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions circle-ci-php7.4-browsers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ RUN \

# install mariadb
RUN sudo apt-get update && sudo apt-get install -y mariadb-server mariadb-client

# setup the mariadb
RUN sudo mysql_install_db --user=mysql --ldata=/var/lib/mysql
RUN sudo service mysql start && sudo mysql -e "CREATE DATABASE wordpress;" \
&& sudo mysql -e "CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'wordpress';" \
&& sudo mysql -e "GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';" \
&& sudo mysql -e "FLUSH PRIVILEGES;"

# cypress dependencies
RUN sudo apt-get update && sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb

USER circleci
Expand All @@ -27,10 +30,16 @@ ARG DOCKERIZE_VERSION=v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz

ADD vcv-auto-authorize.php /var/www/html/wp-content/plugins/
# run php built in server with multithreads PHP_CLI_SERVER_WORKERS=30 php -s localhost:80 -t /var/www/html
RUN sudo service mysql start && wp core config --path=/var/www/html --dbname=wordpress --dbuser=wordpress --dbpass=wordpress --dbhost=0.0.0.0 --allow-root
RUN sudo service mysql start && wp core install --path=/var/www/html --url=http://localhost --title=wordpress --admin_user=admin --admin_password=admin [email protected] --skip-email --allow-root

# install wordpress
RUN sudo service mysql start && \
wp core config --path=/var/www/html --dbname=wordpress --dbuser=wordpress --dbpass=wordpress --dbhost=0.0.0.0 --allow-root \
&& wp core install --path=/var/www/html --url=http://localhost --title=wordpress --admin_user=admin --admin_password=admin [email protected] --skip-email --allow-root \
&& wp plugin install wordpress-importer --activate --path=/var/www/html --allow-root \
&& curl -OL https://raw.githubusercontent.com/poststatus/wptest/master/wptest.xml \
&& wp import wptest.xml --authors=create --path=/var/www/html --allow-root && rm wptest.xml

# setup auto urls
RUN sed -i '1i\
<?php \
#Identify the relevant protocol for the current request\
Expand All @@ -39,5 +48,5 @@ RUN sed -i '1i\
define("WP_SITEURL", \$protocol . "://" . \$_SERVER["HTTP_HOST"]);\
define("WP_HOME", \$protocol . "://" . \$_SERVER["HTTP_HOST"]); ?>' /var/www/html/wp-config.php

#ENV PHP_CLI_SERVER_WORKERS=30
ENV PHP_CLI_SERVER_WORKERS=30
CMD sudo service mysql start && sudo dockerize -wait tcp://localhost:3306 -timeout 60s && PHP_CLI_SERVER_WORKERS=30 php -S 0.0.0.0:80 -t /var/www/html

0 comments on commit 50cc96c

Please sign in to comment.