Created
January 14, 2017 04:01
-
-
Save drmikecrowe/13f9b11b93bacde89506d9c7766ec377 to your computer and use it in GitHub Desktop.
Working PHP Docker Compose System with PhantimJS testing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
actor: Tester | |
paths: | |
tests: tests | |
log: tests/_output | |
data: tests/_data | |
support: tests/_support | |
envs: tests/_envs | |
helpers: tests/_support/Helper | |
settings: | |
bootstrap: _bootstrap.php | |
colors: true | |
memory_limit: 1024M | |
extensions: | |
enabled: | |
- Codeception\Extension\RunFailed | |
- Codeception\Extension\Logger | |
- Codeception\Extension\Recorder | |
modules: | |
config: | |
Db: | |
dsn: 'mysql:host=172.17.0.1;dbname=DBNAME' | |
user: 'root' | |
password: 'PASSWORD' | |
MailCatcher: | |
url: http://172.17.0.1 | |
port: 1080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Generated configuration file | |
* Generated by: phpMyAdmin 4.7.0-dev setup script | |
* Date: Tue, 13 Sep 2016 21:29:20 +0000 | |
*/ | |
/* Servers configuration */ | |
$i = 0; | |
/* Server: Localhost [1] */ | |
$i++; | |
$cfg['Servers'][$i]['verbose'] = 'Localhost'; | |
$cfg['Servers'][$i]['host'] = '172.17.0.1'; | |
$cfg['Servers'][$i]['port'] = ''; | |
$cfg['Servers'][$i]['socket'] = ''; | |
$cfg['Servers'][$i]['connect_type'] = 'tcp'; | |
$cfg['Servers'][$i]['auth_type'] = 'cookie'; | |
$cfg['Servers'][$i]['user'] = 'root'; | |
$cfg['Servers'][$i]['password'] = 'PASSWORD'; | |
/* End of servers configuration */ | |
$cfg['blowfish_secret'] = 'RESETME'; | |
$cfg['UploadDir'] = '/tmp'; | |
$cfg['SaveDir'] = ''; | |
$cfg['DefaultLang'] = 'en'; | |
$cfg['ServerDefault'] = 1; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mailcatcher: | |
image: schickling/mailcatcher | |
ports: | |
- "1025:1025" | |
- "1080:1080" | |
restart: always | |
mysql: | |
image: mysql:5.7 | |
ports: | |
- "3306:3306" | |
volumes: | |
- "./volumes/mysql:/var/lib/mysql" | |
- "./docker/mysql/mysql.cnf:/etc/mysql/mysql.conf.d/mysql.cnf" | |
environment: | |
MYSQL_ROOT_PASSWORD: PASSWORD | |
phpmyadmin: | |
image: phpmyadmin/phpmyadmin | |
links: | |
- mysql:db | |
ports: | |
- "8989:80" | |
environment: | |
PMA_HOST: db | |
PMA_USER: root | |
PMA_PASSWORD: PASSWORD | |
volumes: | |
- "./docker/phpmyadmin/config.inc.php:/config.user.inc.php" | |
#docker run -d -p 80:80 --name my-apache-php-app -v "$PWD":/var/www/html php:7.0-apache | |
webserver: | |
image: php-drmikecrowe | |
links: | |
- mysql:db | |
ports: | |
- 80:80 | |
volumes: | |
- ".:/var/www/html" | |
- "./docker/apache/site.conf:/etc/apache2/sites-available/000-default.conf" | |
phantomjs: | |
image: wernight/phantomjs | |
command: phantomjs --webdriver 8901 | |
links: | |
- mysql:db | |
ports: | |
- "8901:8901" | |
extra_hosts: | |
- "thehostname.dev:172.17.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Build using docker build -t php-drmikecrowe | |
FROM php:5.6-apache | |
MAINTAINER Emilien Kenler <[email protected]> | |
RUN apt-get update && apt-get install -y git libpq-dev libmcrypt-dev zlib1g-dev libicu-dev g++ graphviz && rm -rf /var/lib/apt/lists/* | |
RUN docker-php-ext-install pdo_pgsql pdo_mysql mbstring mcrypt zip sockets intl bcmath mysqli | |
RUN curl -o /usr/local/bin/composer https://getcomposer.org/composer.phar && \ | |
chmod +x /usr/local/bin/composer | |
RUN pecl install xdebug-stable | |
RUN pecl install apcu-4.0.10 | |
RUN echo "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so" > /usr/local/etc/php/conf.d/xdebug.ini && \ | |
echo "xdebug.default_enable = 1" >> /usr/local/etc/php/conf.d/xdebug.ini && \ | |
echo "xdebug.remote_enable = 1" >> /usr/local/etc/php/conf.d/xdebug.ini && \ | |
echo "xdebug.remote_handler = dbgp" >> /usr/local/etc/php/conf.d/xdebug.ini && \ | |
echo "xdebug.remote_autostart = 0" >> /usr/local/etc/php/conf.d/xdebug.ini && \ | |
echo "xdebug.remote_connect_back = 1" >> /usr/local/etc/php/conf.d/xdebug.ini && \ | |
echo "xdebug.remote_port = 9000" >> /usr/local/etc/php/conf.d/xdebug.ini && \ | |
echo "xdebug.remote_host = 172.17.42.1" >> /usr/local/etc/php/conf.d/xdebug.ini && \ | |
echo "xdebug.profiler_enable=0" >> /usr/local/etc/php/conf.d/xdebug.ini && \ | |
echo "xdebug.profiler_enable_trigger=1" >> /usr/local/etc/php/conf.d/xdebug.ini && \ | |
echo "xdebug.profiler_output_dir=\"/tmp\"" >> /usr/local/etc/php/conf.d/xdebug.ini | |
RUN echo "zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/opcache.so" > /usr/local/etc/php/conf.d/opcache.ini | |
RUN echo "extension=apcu.so" > /usr/local/etc/php/conf.d/apcu.ini && \ | |
echo "apc.enable_cli=1" >> /usr/local/etc/php/conf.d/apcu.ini | |
RUN echo "realpath_cache_size=4096k" > /usr/local/etc/php/conf.d/tuning.ini && \ | |
echo "realpath_cache_ttl=300" >> /usr/local/etc/php/conf.d/tuning.ini | |
RUN echo "date.timezone = \"America/New_York\"" >> /usr/local/etc/php/conf.d/timezone.ini | |
ENV APACHE_RUN_USER myuser | |
RUN adduser --uid 1000 --gecos 'My Apache User' --disabled-password myuser \ | |
&& chown -R "$APACHE_RUN_USER:$APACHE_RUN_GROUP" /var/lock/apache2 /var/run/apache2 | |
RUN a2enmod rewrite | |
RUN a2enmod headers | |
EXPOSE 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[client] | |
local-infile = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
ServerName thehostname.dev | |
DocumentRoot /var/www/html | |
<Directory /> | |
AllowOverride All | |
</Directory> | |
<Directory /var/www/html> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride all | |
Require all granted | |
</Directory> | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
</VirtualHost> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment