Initial attempt at using vagrant, not ready for use

This commit is contained in:
Dane Everitt
2018-07-02 23:25:35 -07:00
parent a79224cd2a
commit 3650490005
7 changed files with 232 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
server {
listen 80;
server_name pterodactyl.local;
root /srv/www/public;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/pterodactyl.app-error.log error;
client_max_body_size 100m;
client_body_timeout 120s;
sendfile off;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_PROXY "";
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
}
location ~ /\.ht {
deny all;
}
}

View File

@@ -0,0 +1,11 @@
[Unit]
Description=Pterodactyl Queue Worker
[Service]
User=www-data
Group=www-data
Restart=always
ExecStart=/usr/bin/php /var/www/pterodactyl/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
[Install]
WantedBy=multi-user.target

66
scripts/deploy_app.sh Normal file
View File

@@ -0,0 +1,66 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
# Install the dependencies for core software.
add-apt-repository -y ppa:ondrej/php
apt -y install software-properties-common \
php7.2 \
php7.2-cli \
php7.2-gd \
php7.2-mysql \
php7.2-pdo \
php7.2-mbstring \
php7.2-tokenizer \
php7.2-bcmath \
php7.2-xml \
php7.2-fpm \
php7.2-curl \
php7.2-zip \
nginx \
curl \
tar \
unzip \
git
# Install yarn and NodeJS for development purposes.
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
apt -y update && apt -y install nodejs yarn
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
cd /srv/www
chmod -R 755 storage/* bootstrap/cache
composer install --no-interaction --prefer-dist --no-suggest
# If no environment file is found copy the example one and then generate the key.
# Configure the cronjob
(crontab -l 2>/dev/null; echo "* * * * * php /srv/www/artisan schedule:run >> /dev/null 2>&1") | crontab -
# Configure the process worker
systemctl enable pteroq.service
systemctl start pteroq
# Create symlink
rm /home/vagrant/app
ln -s /srv/www /home/vagrant/app
# Configure OPCache
cat >> /etc/php/7.2/cli/conf.d/10-opcache.ini <<EOF
opcache.revalidate_freq = 0
opcache.max_accelerated_files = 11003
opcache.memory_consumption = 192
opcache.interned_strings_buffer = 16
opcache.fast_shutdown = 1
opcache.enable = 1
opcache.enable_cli = 1
EOF
# Cleanup
rm -rf /var/www
rm -r /etc/nginx/sites-enabled/*
ln -s /etc/nginx/sites-available/pterodactyl.local.conf /etc/nginx/sites-enabled/pterodactyl.local.conf
service nginx restart