I’ve use docker-compose to spin up a new dev server, mount my application directory, and imported my DB. My host machine has 15 GB memory and Intel® Core™ i5-7440HQ CPU @ 2.80GHz × 4 and is running Ubuntu 17.04. Despite this, the site takes 30+seconds to load.
There are a number of media files in my application directory, but I’ve run this site in dev environments (outside of containers) with far less resources and with far better performance.
I am assuming this is volume related but I really do not know where to start. Hoping you will save the day.
version: "2"
services:
web:
image: monin/magento:7.0-apache
hostname: domain.com
ports:
- 80
volumes_from: #when using appdata - below
- appdata
environment:
# XDEBUG_CONFIG - remote_host can be configured with your IP if remmote_connect_back=0.
# Fetch it via `ip route get 8.8.8.8 | awk '{print $NF; exit}'`
- XDEBUG_CONFIG="remote_connect_back=1 idekey=domain profiler_enable=1"
- VIRTUAL_HOST=domain.com
- VIRTUAL_PORT=80
- HTTPS_METHOD=noredirect
- ENABLE_SENDMAIL=false
links:
- db
cron:
image: monin/magento:7.0-cli
hostname: cron.domain.com
working_dir: /var/www/html
command: /run-cron.sh
volumes_from: #when using appdata - below
- appdata
environment:
- ENABLE_SENDMAIL=false
links:
- db
cli:
image: monin/magento:7.0-cli
hostname: cli.domain.com
working_dir: /var/www/html
command: /bin/true
volumes_from: #when using appdata - below
- appdata
links:
- db
db:
image: meanbee/magento-mysql
ports:
- 3306
environment:
- MYSQL_ROOT_PASSWORD=superpw
- MYSQL_USER=magento
- MYSQL_PASSWORD=magento
- MYSQL_DATABASE=magento
redis:
image: "redis:alpine"
appdata:
image: tianon/true
volumes:
#Apache points to /var/www/html which allows us to setup our /us subdirectory
- .:/var/www/html/us