update image for 0.7.11
This commit is contained in:
parent
bedbc140af
commit
e9084d432f
|
@ -11,7 +11,7 @@ server {
|
|||
listen 443 ssl http2;
|
||||
server_name <domain>;
|
||||
|
||||
root /var/www/pterodactyl/public;
|
||||
root /app/public;
|
||||
index index.php;
|
||||
|
||||
access_log /var/log/nginx/pterodactyl.app-access.log;
|
||||
|
@ -49,7 +49,7 @@ server {
|
|||
|
||||
location ~ \.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;
|
||||
include fastcgi_params;
|
||||
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
|
||||
|
|
|
@ -3,19 +3,24 @@
|
|||
|
||||
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
|
||||
if [ -f /app/var/.env ]; then
|
||||
echo "external vars exist"
|
||||
echo "external vars exist."
|
||||
rm /app/.env
|
||||
|
||||
ln -s /app/var/.env /app/
|
||||
else
|
||||
echo "external vars don't exist"
|
||||
echo "external vars don't exist."
|
||||
rm /app/.env
|
||||
touch /app/var/.env
|
||||
|
||||
## 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)
|
||||
echo -e "Generated app key: $APP_KEY"
|
||||
echo -e "APP_KEY=$APP_KEY" > /app/var/.env
|
||||
|
@ -23,6 +28,25 @@ else
|
|||
ln -s /app/var/.env /app/
|
||||
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
|
||||
echo "Checking database status."
|
||||
until nc -z -v -w30 $DB_HOST 3306
|
||||
|
@ -34,13 +58,13 @@ do
|
|||
done
|
||||
|
||||
## 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 db:seed --force
|
||||
|
||||
## start cronjobs for the queue
|
||||
echo -e "Starting cron jobs"
|
||||
crond
|
||||
echo -e "Starting cron jobs."
|
||||
crond -L /var/log/crond -l 5
|
||||
|
||||
echo -e "Starting supervisord"
|
||||
echo -e "Starting supervisord."
|
||||
exec "$@"
|
|
@ -15,9 +15,9 @@ RUN cp .env.example .env \
|
|||
RUN cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf \
|
||||
&& cp .dev/docker/www.conf /etc/php7/php-fpm.d/www.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 \
|
||||
&& mkdir -p /var/run/php /var/run/nginx \
|
||||
&& mkdir -p /var/log/supervisord/
|
||||
&& echo "* * * * * /usr/bin/php /app/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
|
||||
&& sed -i s/ssl_session_cache/#ssl_session_cache/g /etc/nginx/nginx.conf \
|
||||
&& mkdir -p /var/run/php /var/run/nginx
|
||||
|
||||
EXPOSE 80 443
|
||||
|
||||
|
|
|
@ -25,6 +25,9 @@ services:
|
|||
- cache
|
||||
volumes:
|
||||
- "/srv/pterodactyl/var/:/app/var/"
|
||||
- "/srv/pterodactyl/nginx/:/etc/nginx/conf.d/"
|
||||
- "/srv/pterodactyl/certs/:/etc/letsencrypt/"
|
||||
- "/srv/pterodactyl/logs/:/var/log/"
|
||||
environment:
|
||||
## These are defaults and should be left alone
|
||||
- "APP_ENV=production"
|
||||
|
@ -44,14 +47,14 @@ services:
|
|||
- "REDIS_PASSWORD=null"
|
||||
- "REDIS_PORT=6379"
|
||||
## 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
|
||||
- "APP_TIMEZONE=America/New_York"
|
||||
- "APP_TIMEZONE=UTC" ## http://php.net/manual/en/timezones.php
|
||||
## 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
|
||||
## change if you want it to be more secure.
|
||||
- "DB_HOST=database"
|
||||
## These can be left alone. Only change if you know what you are doing.
|
||||
- "DB_HOST=database"
|
||||
- "DB_PORT=3306"
|
||||
- "DB_DATABASE=pterodb"
|
||||
- "DB_USERNAME=ptero"
|
||||
|
@ -64,6 +67,8 @@ services:
|
|||
- "MAIL_USERNAME=''"
|
||||
- "MAIL_PASSWORD=''"
|
||||
- "MAIL_ENCRYPTION=true"
|
||||
## certbot settings - Used to automatically generate ssl certs and
|
||||
- "LE_EMAIL=''" ## leave blank unless you aree generating certs.
|
||||
|
||||
networks:
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue