update image for 0.7.11

This commit is contained in:
Michael (Parker) Parker 2018-11-10 18:57:49 -05:00
parent bedbc140af
commit e9084d432f
4 changed files with 46 additions and 17 deletions

View file

@ -11,7 +11,7 @@ server {
listen 443 ssl http2; listen 443 ssl http2;
server_name <domain>; server_name <domain>;
root /var/www/pterodactyl/public; root /app/public;
index index.php; index index.php;
access_log /var/log/nginx/pterodactyl.app-access.log; access_log /var/log/nginx/pterodactyl.app-access.log;
@ -49,7 +49,7 @@ server {
location ~ \.php$ { location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/pterodactyl.sock; fastcgi_pass unix:/var/run/php/php-fpm7.2.sock;
fastcgi_index index.php; fastcgi_index index.php;
include fastcgi_params; include fastcgi_params;
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M"; fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";

View file

@ -3,19 +3,24 @@
cd /app cd /app
mkdir -p /var/log/panel/logs/ /var/log/supervisord/ /var/log/nginx/ /var/log/php7/ \
&& rmdir /app/storage/logs/ \
&& chmod 777 /var/log/panel/logs/ \
&& ln -s /var/log/panel/logs/ /app/storage/
## check for .env file and generate app keys if missing ## check for .env file and generate app keys if missing
if [ -f /app/var/.env ]; then if [ -f /app/var/.env ]; then
echo "external vars exist" echo "external vars exist."
rm /app/.env rm /app/.env
ln -s /app/var/.env /app/ ln -s /app/var/.env /app/
else else
echo "external vars don't exist" echo "external vars don't exist."
rm /app/.env rm /app/.env
touch /app/var/.env touch /app/var/.env
## manually generate a key because key generate --force fails ## manually generate a key because key generate --force fails
echo -e "Generating key" echo -e "Generating key."
APP_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) APP_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo -e "Generated app key: $APP_KEY" echo -e "Generated app key: $APP_KEY"
echo -e "APP_KEY=$APP_KEY" > /app/var/.env echo -e "APP_KEY=$APP_KEY" > /app/var/.env
@ -23,6 +28,25 @@ else
ln -s /app/var/.env /app/ ln -s /app/var/.env /app/
fi fi
echo "Checking if https is required."
if [ -f /etc/nginx/conf.d/default.conf ]; then
echo "Using nginx config already in place."
else
echo "Checking if letsencrypt email is set."
if [ -z $LE_EMAIL ]; then
echo "No letsencrypt email is set Failing to http."
cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf
else
echo "writing ssl config"
cp .dev/docker/default_ssl.conf /etc/nginx/conf.d/default.conf
echo "updating ssl config for domain"
sed -i "s|<domain>|$(echo $APP_URL | sed 's~http[s]*://~~g')|g" /etc/nginx/conf.d/default.conf
echo "generating certs"
certbot certonly -d $(echo $APP_URL | sed 's~http[s]*://~~g') --standalone -m $LE_EMAIL --agree-tos -n
fi
fi
## check for DB up before starting the panel ## check for DB up before starting the panel
echo "Checking database status." echo "Checking database status."
until nc -z -v -w30 $DB_HOST 3306 until nc -z -v -w30 $DB_HOST 3306
@ -34,13 +58,13 @@ do
done done
## make sure the db is set up ## make sure the db is set up
echo -e "Migrating and Seeding DB" echo -e "Migrating and Seeding D.B"
php artisan migrate --force php artisan migrate --force
php artisan db:seed --force php artisan db:seed --force
## start cronjobs for the queue ## start cronjobs for the queue
echo -e "Starting cron jobs" echo -e "Starting cron jobs."
crond crond -L /var/log/crond -l 5
echo -e "Starting supervisord" echo -e "Starting supervisord."
exec "$@" exec "$@"

View file

@ -15,9 +15,9 @@ RUN cp .env.example .env \
RUN cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf \ RUN cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf \
&& cp .dev/docker/www.conf /etc/php7/php-fpm.d/www.conf \ && cp .dev/docker/www.conf /etc/php7/php-fpm.d/www.conf \
&& cat .dev/docker/supervisord.conf > /etc/supervisord.conf \ && cat .dev/docker/supervisord.conf > /etc/supervisord.conf \
&& echo "* * * * * /usr/bin/php /app/pterodactyl/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \ && echo "* * * * * /usr/bin/php /app/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
&& mkdir -p /var/run/php /var/run/nginx \ && sed -i s/ssl_session_cache/#ssl_session_cache/g /etc/nginx/nginx.conf \
&& mkdir -p /var/log/supervisord/ && mkdir -p /var/run/php /var/run/nginx
EXPOSE 80 443 EXPOSE 80 443

View file

@ -25,6 +25,9 @@ services:
- cache - cache
volumes: volumes:
- "/srv/pterodactyl/var/:/app/var/" - "/srv/pterodactyl/var/:/app/var/"
- "/srv/pterodactyl/nginx/:/etc/nginx/conf.d/"
- "/srv/pterodactyl/certs/:/etc/letsencrypt/"
- "/srv/pterodactyl/logs/:/var/log/"
environment: environment:
## These are defaults and should be left alone ## These are defaults and should be left alone
- "APP_ENV=production" - "APP_ENV=production"
@ -44,14 +47,14 @@ services:
- "REDIS_PASSWORD=null" - "REDIS_PASSWORD=null"
- "REDIS_PORT=6379" - "REDIS_PORT=6379"
## Domain settings ## Domain settings
- "APP_URL=https://your.domain.here" - "APP_URL=https://your.domain.here" ## if you are running this behind a reverse proxy with ssl app_url needs to be https still.
## Timezone settings ## Timezone settings
- "APP_TIMEZONE=America/New_York" - "APP_TIMEZONE=UTC" ## http://php.net/manual/en/timezones.php
## Service egg settings ## Service egg settings
- "APP_SERVICE_AUTHOR=noreply@your.domain.here" - "APP_SERVICE_AUTHOR=noreply@your.domain.here" ## this is the email that gets put on eggs you create
## Database settings ## Database settings
## change if you want it to be more secure. ## These can be left alone. Only change if you know what you are doing.
- "DB_HOST=database" - "DB_HOST=database"
- "DB_PORT=3306" - "DB_PORT=3306"
- "DB_DATABASE=pterodb" - "DB_DATABASE=pterodb"
- "DB_USERNAME=ptero" - "DB_USERNAME=ptero"
@ -64,6 +67,8 @@ services:
- "MAIL_USERNAME=''" - "MAIL_USERNAME=''"
- "MAIL_PASSWORD=''" - "MAIL_PASSWORD=''"
- "MAIL_ENCRYPTION=true" - "MAIL_ENCRYPTION=true"
## certbot settings - Used to automatically generate ssl certs and
- "LE_EMAIL=''" ## leave blank unless you aree generating certs.
networks: networks:
default: default: