Files
wp-graphql-woocommerce/docker/testing.Dockerfile
T

64 lines
2.8 KiB
Docker
Raw Normal View History

############################################################################
# Container for running Codeception tests on a WooGraphQL Docker instance. #
############################################################################
# Using the 'DESIRED_' prefix to avoid confusion with environment variables of the same name.
2020-05-11 13:51:08 -04:00
FROM woographql-app:latest
2019-07-25 15:17:50 -04:00
LABEL author=kidunot89
LABEL author_uri=https://github.com/kidunot89
2019-07-17 20:02:41 -04:00
2019-07-18 11:39:14 -04:00
SHELL [ "/bin/bash", "-c" ]
2019-11-16 19:35:48 -05:00
# Redeclare ARGs and set as environmental variables for reuse.
ARG USE_XDEBUG
ENV USING_XDEBUG=${USE_XDEBUG}
2019-07-25 15:17:50 -04:00
# Install php extensions
RUN docker-php-ext-install pdo_mysql
2019-07-18 11:39:14 -04:00
2019-11-16 19:35:48 -05:00
# Install PCOV and XDebug
RUN if [ "$PHP_VERSION" != "5.6" ] && [ "$PHP_VERSION" != "7.0" ] && [[ -z "$USING_XDEBUG" ]]; then \
2019-11-16 19:35:48 -05:00
apt-get install zip unzip -y && \
pecl install pcov && \
docker-php-ext-enable pcov && \
rm -f /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini && \
echo "pcov.enabled=1" >> /usr/local/etc/php/php.ini ;\
elif [ "$PHP_VERSION" == "5.6" ]; then \
2019-12-09 22:08:04 -05:00
yes | pecl install xdebug-2.5.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini; \
2020-05-11 13:51:08 -04:00
elif [ "$PHP_VERSION" == "7.0" ] || [ -n "$USING_XDEBUG" ]; then \
yes | pecl install xdebug-2.6.1 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini; \
2019-11-16 19:35:48 -05:00
else \
2019-12-09 22:08:04 -05:00
yes | pecl install xdebug \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_enable=on" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.remote_autostart=off" >> /usr/local/etc/php/conf.d/xdebug.ini; \
2019-11-16 12:08:41 -05:00
fi
2019-07-18 11:39:14 -04:00
# Install composer
ENV COMPOSER_ALLOW_SUPERUSER=1
2019-07-18 11:39:14 -04:00
RUN curl -sS https://getcomposer.org/installer | php -- \
--filename=composer \
--install-dir=/usr/local/bin
# Add composer global binaries to PATH
ENV PATH "$PATH:~/.composer/vendor/bin"
2019-07-18 11:39:14 -04:00
# Configure php
RUN echo "date.timezone = UTC" >> /usr/local/etc/php/php.ini
# Remove exec statement from base entrypoint script.
RUN sed -i '$d' /usr/local/bin/app-entrypoint.sh
2019-07-18 11:39:14 -04:00
# Set up entrypoint
2019-07-28 00:58:22 -04:00
WORKDIR /var/www/html/wp-content/plugins/wp-graphql-woocommerce
2020-05-11 13:51:08 -04:00
COPY docker/testing.entrypoint.sh /usr/local/bin/testing-entrypoint.sh
RUN chmod 755 /usr/local/bin/testing-entrypoint.sh
ENTRYPOINT ["testing-entrypoint.sh"]