docker4drupal
docker4drupal copied to clipboard
Very long GatsbyJS build from JSON:API
Codebase Mounted codebase
Describe your issue When i use Drupal from docker container for GatsbyJS development/production build it takes very long to finish, in comparison, once running Drupal without container (from remote server) build is 6x faster. GatsbyJS consumes data over HTTP requests (JSON:API endpoints). Switching Drupal to "production" mode, engaging caching gives no improvement.
Output of docker info
Client:
Debug Mode: false
Server:
Containers: 7
Running: 7
Paused: 0
Stopped: 0
Images: 43
Server Version: 19.03.5
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: b34a5c8af56e510852c35414db4c1f4fa6172339
runc version: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
init version: fec3683
Security Options:
seccomp
Profile: default
Kernel Version: 4.19.76-linuxkit
Operating System: Docker Desktop
OSType: linux
Architecture: x86_64
CPUs: 3
Total Memory: 3.846GiB
Name: docker-desktop
ID: T2KF:AR4U:QDRC:EZCF:JZ2M:YWAU:OZZ6:3LL3:QEOW:K3YV:T2KM:NXGI
Docker Root Dir: /var/lib/docker
Debug Mode: true
File Descriptors: 89
Goroutines: 98
System Time: 2020-01-22T21:50:47.2536022Z
EventsListeners: 4
HTTP Proxy: gateway.docker.internal:3128
HTTPS Proxy: gateway.docker.internal:3129
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Product License: Community Engine
Contents of your docker-compose.yml
# Repo file is untouched i overwritten services in my own file:
version: "3"
services:
mariadb:
volumes:
- ./custom/volumes/mariadb:/var/lib/mysql:cached # Use bind mount
php:
volumes:
- ./custom/src/drupal:/var/www/html:cached # User-guided caching
nginx:
volumes:
- ./custom/src/drupal:/var/www/html:cached # User-guided caching
pma:
image: phpmyadmin/phpmyadmin
container_name: "${PROJECT_NAME}_pma"
environment:
PMA_HOST: $DB_HOST
PMA_USER: $DB_USER
PMA_PASSWORD: $DB_PASSWORD
PHP_UPLOAD_MAX_FILESIZE: 1G
PHP_MAX_INPUT_VARS: 1G
labels:
- "traefik.http.routers.${PROJECT_NAME}_pma.rule=Host(`pma.${PROJECT_BASE_URL}`)"
Contents of your .env
PROJECT_NAME=project
PROJECT_BASE_URL=project.local
DB_NAME=drupal
DB_USER=drupal
DB_PASSWORD=drupal
DB_ROOT_PASSWORD=password
DB_HOST=mariadb
DB_PORT=3306
DB_DRIVER=mysql
MARIADB_TAG=10.1-3.3.15
DRUPAL_TAG=8-4.14.23
PHP_TAG=7.3-dev-macos-4.13.18
NGINX_TAG=1.17-5.7.2
NGINX_VHOST_PRESET=drupal8
SOLR_CONFIG_SET="search_api_solr_8.x-3.2"
SOLR_TAG=8-4.1.1
ELASTICSEARCH_TAG=7-5.2.3
KIBANA_TAG=7-5.2.3
REDIS_TAG=4-3.1.4
NODE_TAG=12-0.28.1
VARNISH_TAG=6.0-4.3.6
POSTGRES_TAG=12-1.8.0
ADMINER_TAG=4-3.7.0
APACHE_TAG=2.4-4.1.4
ATHENAPDF_TAG=2.10.0
DRUPAL_NODE_TAG=1.0-2.0.0
MEMCACHED_TAG=1-2.3.6
OPENSMTPD_TAG=6.0-1.5.4
RSYSLOG_TAG=latest
SELENIUM_CHROME_TAG=3.141
WEBGRIND_TAG=1.5-1.12.0
XHPROF_TAG=1.5.0
Logs output docker-compose logs
Paste here
I personally don't use docker locally for frontend development with node.js because the filesystem is too slow. So unless you have a specific need for containers, e.g. have multiple node versions for different projects, I would recommend working directly on your host machine.
@csandanov thank you for a reply. As you have seen i use ":cached" for file system speed up, maybe i should check build times using docker-sync.