My problem is the following - I have Docker on OSX with containers containing Redis, NginX, PHP 7 and Unison. Mapped to php-container I have volume with Symfony 3.1.7.
Everything works, but Symfony's "Welcome" page taked ~1.5 second loading time on average. At the same time same setup without docker gives me 0.2 second loading time. Same difference I got for Symfony's console commands, so, I guess, it's not the problem with NginX, and Unison should've negated all issues related to Docker files sync on OSX problem.
Right now I've ran out of ideas what can I do to speed things up and how to figure out what creates that 1.5s delay.
I have same issue on my second MBP, but such thing does not happen on colleagues laptop, which is similar to the one I have, but we were unable to find any difference between two setups.
Everything is running on my MBP with 2.5 GHz i5, 8 Gb RAM and SSD.
Docker 1.12.3, OSX 10.12.1 (Sierra)
docker-compose.yml:
mydockerbox-redis:
image: phpdockerio/redis:latest
container_name: mydockerbox-redis
mydockerbox-webserver:
image: phpdockerio/nginx:latest
container_name: mydockerbox-webserver
volumes:
- ..:/var/www/mydockerbox
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
ports:
- "80:80"
links:
- mydockerbox-php-fpm
unison:
image: leighmcculloch/unison:latest
environment:
- UNISON_WORKING_DIR=/unison
volumes:
- ../mydockerbox:/var/www/mydockerbox
ports:
- "5000:5000"
mydockerbox-php-fpm:
build: .
dockerfile: php-fpm/Dockerfile
container_name: mydockerbox-php-fpm
volumes_from:
- unison
volumes:
- ./php-fpm/php-ini-overrides.ini:/etc/php/7.0/fpm/conf.d/99-overrides.ini
links:
- mydockerbox-redis
UPD And here is Dockerfile for php-fpm container:
FROM phpdockerio/php7-fpm:latest
# Install selected extensions and other stuff
RUN apt-get update \
&& apt-get -y --no-install-recommends install php7.0-mongodb php7.0-redis php7.0-igbinary \
&& apt-get clean; rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
WORKDIR "/var/www/mydockerbox"