Fix the disasterous performance

Disables xdebug on the CLI to make tests run in a few seconds rather than taking minutes.

Also adds support for using docker-sync for "native" performance in the docker container. If you choose to not use it, vagrant will mount the files using the standard osx method which is slower, but still within reasonable bounds.
This commit is contained in:
Dane Everitt 2018-07-14 20:50:42 -07:00
parent 0e2b4d85b5
commit 23fefe41cc
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
5 changed files with 22 additions and 2 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.vagrant/**
**/.DS_Store
.data/**
.docker-sync/**

8
Vagrantfile vendored
View File

@ -32,7 +32,13 @@ Vagrant.configure("2") do |config|
d.image = "quay.io/pterodactyl/vagrant-panel"
d.create_args = ["-it", "--add-host=host.pterodactyl.local:172.18.0.1"]
d.ports = ["80:80", "8080:8080", "8081:8081"]
d.volumes = ["#{vagrant_root}/code/panel:/srv/www:cached"]
if ENV['FILE_SYNC_METHOD'] === 'docker-sync'
d.volumes = ["panel-sync:/srv/www:nocopy"]
else
d.volumes = ["#{vagrant_root}/code/panel:/srv/www:cached"]
end
d.remains_running = true
d.has_ssh = true
end

7
docker-sync.yml Normal file
View File

@ -0,0 +1,7 @@
version: "2"
syncs:
panel-sync:
sync_strategy: "native_osx"
src: "./code/panel/"
sync_excludes: [".idea", ".git", ".vagrant", "node_modules"]
host_disk_mount_mode: "cached"

View File

@ -7,6 +7,9 @@ cp /tmp/.deploy/pterodactyl.local.conf /etc/nginx/sites-available/pterodactyl.lo
# Needed for FPM to start correctly.
mkdir -p /run/php
# Disable xdebug on the CLI for _MASSIVE_ performance improvement
phpdismod -s cli xdebug
cd /srv/www
chmod -R 755 storage/* bootstrap/cache
@ -21,7 +24,7 @@ fi
sed -i "s/APP_ENV=.*/APP_ENV=local/" .env
sed -i "s/APP_DEBUG=.*/APP_DEBUG=true/" .env
composer install --no-interaction --prefer-dist --no-suggest --no-scripts
composer install --no-interaction --prefer-dist --no-suggest --no-scripts --no-progress
php artisan config:clear
# Configure the cronjob

View File

@ -6,3 +6,6 @@ vagrant plugin install vagrant-hostmanager
cd $currentDirectory
git clone https://github.com/pterodactyl/panel.git code/panel
# sudo gem install docker-sync
# docker-sync start