Skip to content

Commit e9084d4

Browse files
committed
update image for 0.7.11
1 parent bedbc14 commit e9084d4

File tree

4 files changed

+46
-17
lines changed

4 files changed

+46
-17
lines changed

.dev/docker/default_ssl.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ server {
1111
listen 443 ssl http2;
1212
server_name <domain>;
1313

14-
root /var/www/pterodactyl/public;
14+
root /app/public;
1515
index index.php;
1616

1717
access_log /var/log/nginx/pterodactyl.app-access.log;
@@ -49,7 +49,7 @@ server {
4949

5050
location ~ \.php$ {
5151
fastcgi_split_path_info ^(.+\.php)(/.+)$;
52-
fastcgi_pass unix:/run/php/pterodactyl.sock;
52+
fastcgi_pass unix:/var/run/php/php-fpm7.2.sock;
5353
fastcgi_index index.php;
5454
include fastcgi_params;
5555
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";

.dev/docker/entrypoint.sh

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,50 @@
33

44
cd /app
55

6+
mkdir -p /var/log/panel/logs/ /var/log/supervisord/ /var/log/nginx/ /var/log/php7/ \
7+
&& rmdir /app/storage/logs/ \
8+
&& chmod 777 /var/log/panel/logs/ \
9+
&& ln -s /var/log/panel/logs/ /app/storage/
10+
611
## check for .env file and generate app keys if missing
712
if [ -f /app/var/.env ]; then
8-
echo "external vars exist"
13+
echo "external vars exist."
914
rm /app/.env
1015

1116
ln -s /app/var/.env /app/
1217
else
13-
echo "external vars don't exist"
18+
echo "external vars don't exist."
1419
rm /app/.env
1520
touch /app/var/.env
1621

1722
## manually generate a key because key generate --force fails
18-
echo -e "Generating key"
23+
echo -e "Generating key."
1924
APP_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
2025
echo -e "Generated app key: $APP_KEY"
2126
echo -e "APP_KEY=$APP_KEY" > /app/var/.env
2227

2328
ln -s /app/var/.env /app/
2429
fi
2530

31+
echo "Checking if https is required."
32+
if [ -f /etc/nginx/conf.d/default.conf ]; then
33+
echo "Using nginx config already in place."
34+
else
35+
echo "Checking if letsencrypt email is set."
36+
if [ -z $LE_EMAIL ]; then
37+
echo "No letsencrypt email is set Failing to http."
38+
cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf
39+
40+
else
41+
echo "writing ssl config"
42+
cp .dev/docker/default_ssl.conf /etc/nginx/conf.d/default.conf
43+
echo "updating ssl config for domain"
44+
sed -i "s|<domain>|$(echo $APP_URL | sed 's~http[s]*://~~g')|g" /etc/nginx/conf.d/default.conf
45+
echo "generating certs"
46+
certbot certonly -d $(echo $APP_URL | sed 's~http[s]*://~~g') --standalone -m $LE_EMAIL --agree-tos -n
47+
fi
48+
fi
49+
2650
## check for DB up before starting the panel
2751
echo "Checking database status."
2852
until nc -z -v -w30 $DB_HOST 3306
@@ -34,13 +58,13 @@ do
3458
done
3559

3660
## make sure the db is set up
37-
echo -e "Migrating and Seeding DB"
61+
echo -e "Migrating and Seeding D.B"
3862
php artisan migrate --force
3963
php artisan db:seed --force
4064

4165
## start cronjobs for the queue
42-
echo -e "Starting cron jobs"
43-
crond
66+
echo -e "Starting cron jobs."
67+
crond -L /var/log/crond -l 5
4468

45-
echo -e "Starting supervisord"
69+
echo -e "Starting supervisord."
4670
exec "$@"

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ RUN cp .env.example .env \
1515
RUN cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf \
1616
&& cp .dev/docker/www.conf /etc/php7/php-fpm.d/www.conf \
1717
&& cat .dev/docker/supervisord.conf > /etc/supervisord.conf \
18-
&& echo "* * * * * /usr/bin/php /app/pterodactyl/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
19-
&& mkdir -p /var/run/php /var/run/nginx \
20-
&& mkdir -p /var/log/supervisord/
18+
&& echo "* * * * * /usr/bin/php /app/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
19+
&& sed -i s/ssl_session_cache/#ssl_session_cache/g /etc/nginx/nginx.conf \
20+
&& mkdir -p /var/run/php /var/run/nginx
2121

2222
EXPOSE 80 443
2323

docker-compose.example.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ services:
2525
- cache
2626
volumes:
2727
- "/srv/pterodactyl/var/:/app/var/"
28+
- "/srv/pterodactyl/nginx/:/etc/nginx/conf.d/"
29+
- "/srv/pterodactyl/certs/:/etc/letsencrypt/"
30+
- "/srv/pterodactyl/logs/:/var/log/"
2831
environment:
2932
## These are defaults and should be left alone
3033
- "APP_ENV=production"
@@ -44,14 +47,14 @@ services:
4447
- "REDIS_PASSWORD=null"
4548
- "REDIS_PORT=6379"
4649
## Domain settings
47-
- "APP_URL=https://your.domain.here"
50+
- "APP_URL=https://your.domain.here" ## if you are running this behind a reverse proxy with ssl app_url needs to be https still.
4851
## Timezone settings
49-
- "APP_TIMEZONE=America/New_York"
52+
- "APP_TIMEZONE=UTC" ## http://php.net/manual/en/timezones.php
5053
## Service egg settings
51-
- "APP_SERVICE_AUTHOR=noreply@your.domain.here"
54+
- "APP_SERVICE_AUTHOR=noreply@your.domain.here" ## this is the email that gets put on eggs you create
5255
## Database settings
53-
## change if you want it to be more secure.
54-
- "DB_HOST=database"
56+
## These can be left alone. Only change if you know what you are doing.
57+
- "DB_HOST=database"
5558
- "DB_PORT=3306"
5659
- "DB_DATABASE=pterodb"
5760
- "DB_USERNAME=ptero"
@@ -64,6 +67,8 @@ services:
6467
- "MAIL_USERNAME=''"
6568
- "MAIL_PASSWORD=''"
6669
- "MAIL_ENCRYPTION=true"
70+
## certbot settings - Used to automatically generate ssl certs and
71+
- "LE_EMAIL=''" ## leave blank unless you aree generating certs.
6772

6873
networks:
6974
default:

0 commit comments

Comments
 (0)