20 Commits
Author SHA1 Message Date
saibotk 9a3b11b38f Upgrade to panel v0.7.18 2020-08-09 03:50:13 +02:00
saibotk 07d904c6aa Upgrade to panel v0.7.17 2020-03-18 19:31:56 +01:00
saibotk c199522df9 Upgrade to panel v0.7.16 2020-01-07 11:27:25 +01:00
saibotk 9496f05331 adjust trusted proxies setup | Panel 0.7.15 2019-08-18 12:35:04 +02:00
saibotk 63b7ef7f48 fix install and cronjob 2019-07-29 12:56:11 +02:00
saibotk a317ba0926 adjust crontab installation 2019-07-29 12:15:36 +02:00
saibotk 029b83f4dc fix queue schedule 2019-07-29 05:15:38 +02:00
saibotk 937f0fff2a fix queue workers 2019-07-29 04:34:54 +02:00
saibotk 31cadb9402 nginx being serious 2019-07-29 03:38:44 +02:00
saibotk 279424d86d fix nginx again 2019-07-29 03:21:50 +02:00
saibotk 2e419d994c nginx has a weird syntax 2019-07-29 03:17:20 +02:00
saibotk 589eee5026 fix nginx config 2019-07-29 03:16:06 +02:00
saibotk bee69cfbad add hsts header and https redirect for reverse proxy setups 2019-07-29 03:05:59 +02:00
saibotk 6a2f0ba6fe adjust install scripts | allow user to enter trusted proxies value 2019-07-29 02:23:34 +02:00
saibotk efb51d03b0 remove workaround | update to v0.7.14 2019-07-29 02:22:48 +02:00
saibotk d9986ec331 Revert weird changes and made it work with volumes again 2018-11-10 16:03:32 +01:00
Birkhoff Lee 9110c72fe5 Add workaround for pterodactyl/panel/issues/1369 2018-11-06 10:18:17 +08:00
Birkhoff Lee a692b53ffa bump version to 0.7.10 2018-11-05 10:30:50 +08:00
BirkhoffLee b239d6aa18 Improve Dockerfile
Add restart policy. Use Traefik
2018-08-04 12:48:44 +08:00
sachk bf3bb03e7e Fix annoying only uppercase Y thingo 2018-06-11 18:20:21 +10:00
9 changed files with 81 additions and 49 deletions
-1
View File
@@ -1 +0,0 @@
docker-compose.yml
+4 -2
View File
@@ -1,5 +1,4 @@
# pterodactyl-panel-docker
[![GitHub release](https://img.shields.io/github/release/TehTotalPwnage/pterodactyl-panel-docker.svg?style=for-the-badge)](https://github.com/TehTotalPwnage/pterodactyl-panel-docker/releases)
# Pterodactyl panel Docker container
> Docker Compose configuration for the [Pterodactyl Panel](https://github.com/Pterodactyl/Panel).
Pterodactyl is an open-source control panel used for hosting numerous game-related
@@ -22,6 +21,9 @@ of containers and Dockerfiles.
that Nginx performs better than Caddy in handling requests. In addition to this,
Nginx, while having a more complicated configuration file, doesn't enforce HTTPS,
a feature of Caddy which only complicates the setup of the HTTP Docker container.
3. Additionally, if the nginx receives a request from a reverse proxy, it will set the HSTS header
and redirect to HTTPS automatically. If you do not want this behaviour, adjust the `nginx.conf`
as you like.
## Usage
The instructions are fairly self explanatory: clone the repository and launch the
+12 -3
View File
@@ -1,34 +1,41 @@
version: "3"
version: "3.1"
services:
db:
image: mariadb
restart: unless-stopped
environment:
- "MYSQL_DATABASE=pterodactyl"
- "MYSQL_PASSWORD=pterodactyl"
- "MYSQL_RANDOM_ROOT_PASSWORD=yes"
- "MYSQL_USER=pterodactyl"
image: mariadb:latest
networks:
- default
volumes:
- db:/var/lib/mysql
http:
build:
context: services/http
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- "php"
ports:
- "80:80"
- 80:80
networks:
- default
volumes:
- env:/var/www/html/env
- panel:/var/www/html/pterodactyl
- storage:/var/www/html/pterodactyl/storage
php:
build:
context: services/php
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- "db"
networks:
@@ -37,8 +44,10 @@ services:
- env:/var/www/html/env
- panel:/var/www/html/pterodactyl
- storage:/var/www/html/pterodactyl/storage
redis:
image: redis:alpine
restart: unless-stopped
networks:
- default
+1 -1
View File
@@ -1,4 +1,4 @@
FROM nginx:alpine
FROM docker.io/library/nginx:alpine
LABEL maintainer="tehtotalpwnage@gmail.com"
+19 -1
View File
@@ -26,6 +26,12 @@ http {
keepalive_timeout 65;
#gzip on;
# Set HSTS if forwarded proto is https
map $http_x_forwarded_proto $hsts_header {
default "";
https "max-age=31536000; includeSubDomains;";
}
server {
listen 80 default_server;
@@ -36,6 +42,17 @@ http {
access_log off;
error_log /var/log/nginx/pterodactyl.app-error.log error;
# Redirect to https
if ($http_x_forwarded_proto != "https") {
set $shouldRedirectToHTTPS 1;
}
if ($http_x_forwarded_proto = false) {
set $shouldRedirectToHTTPS 0;
}
if ($shouldRedirectToHTTPS = 1) {
return 301 https://$host$request_uri;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
@@ -48,7 +65,8 @@ http {
location = /robots.txt { access_log off; log_not_found off; }
sendfile off;
add_header Strict-Transport-Security $hsts_header;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header X-Robots-Tag none;
+30 -32
View File
@@ -1,52 +1,50 @@
FROM php:7.2-fpm-alpine
FROM docker.io/library/php:7.3-fpm-alpine
ENV PANEL_VERSION=v0.7.7
ENV PANEL_VERSION=v0.7.18
# Set up all the dependencies for the PHP container.
RUN apk add --no-cache curl git supervisor tar unzip
RUN docker-php-ext-install bcmath
# https://github.com/docker-library/php/issues/483
# RUN docker-php-ext-install curl
# https://stackoverflow.com/questions/39657058/installing-gd-in-docker#39658592
RUN apk add --no-cache libpng-dev
RUN docker-php-ext-install gd
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install pdo
RUN docker-php-ext-install pdo_mysql
RUN docker-php-ext-install tokenizer
# https://lists.alpinelinux.org/alpine-aports/2526.html
RUN apk add --no-cache libxml2-dev
RUN docker-php-ext-install xml
RUN docker-php-ext-install zip
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN apk add --no-cache curl git supervisor tar unzip; \
docker-php-ext-install bcmath; \
apk add --no-cache libpng-dev; \
docker-php-ext-install gd; \
docker-php-ext-install mbstring; \
docker-php-ext-install pdo; \
docker-php-ext-install pdo_mysql; \
docker-php-ext-install tokenizer; \
apk add --no-cache libxml2-dev; \
docker-php-ext-install xml; \
docker-php-ext-install zip; \
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Set up the server working directories.
RUN adduser -g '' -D -u 9999 pterodactyl
RUN mkdir -p /var/www/html/env
RUN mkdir -p /var/www/html/pterodactyl
RUN adduser -g '' -D -u 9999 pterodactyl; \
mkdir -p /var/www/html/env; \
mkdir -p /var/www/html/pterodactyl
WORKDIR /var/www/html/pterodactyl
RUN chown -R pterodactyl:pterodactyl /var/www/html/pterodactyl /var/www/html/env
# Deploy panel files.
USER pterodactyl:pterodactyl
RUN curl -Lo panel.tar.gz https://github.com/Pterodactyl/Panel/releases/download/${PANEL_VERSION}/panel.tar.gz
RUN tar --strip-components=1 -xzvf panel.tar.gz
# Since Docker's configuration mounting feature sucks, we're going to use a cheap
# workaround involving symbolic links.
RUN cp .env.example /var/www/html/env/.env
RUN ln -s /var/www/html/env/.env /var/www/html/pterodactyl/.env
RUN composer install --no-dev
RUN chmod -R 755 storage/* bootstrap/cache
RUN curl -Lo panel.tar.gz https://github.com/Pterodactyl/Panel/releases/download/${PANEL_VERSION}/panel.tar.gz; \
tar --strip-components=1 -xzvf panel.tar.gz; \
cp .env.example /var/www/html/env/.env; \
ln -s /var/www/html/env/.env /var/www/html/pterodactyl/.env; \
composer install --no-dev --optimize-autoloader; \
chmod -R 755 storage/* bootstrap/cache
# Copy the remaining configuration files.
USER root:root
RUN mkdir -p /var/log/pterodactyl
COPY install.sh /usr/local/bin/install
RUN chmod +x /usr/local/bin/install
COPY upgrade.sh /usr/local/bin/upgrade
RUN chmod +x /usr/local/bin/upgrade
COPY schedule /var/spoon/cron/crontabs/schedule
COPY schedule .
COPY supervisord.conf /etc/supervisor/supervisord.conf
COPY www.conf /usr/local/etc/php-fpm.d/www.conf
RUN cat schedule >> /var/spool/cron/crontabs/root; \
chmod +x /usr/local/bin/install; \
chmod +x /usr/local/bin/upgrade
ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]
+11 -3
View File
@@ -12,13 +12,21 @@ fi
echo "Are you sure you want to continue the install script? (Y/n)"
read -n1 run
if [ "$run" = "Y" ]; then
if [ "$run" = "y" ] || [ "$run" = "Y" ]; then
echo "Running install script."
echo "Waiting 15 seconds for MariaDB to be ready."
sleep 15
echo "Adding additional parameters to .env file."
printf "\n\nTRUSTED_PROXIES=*" >> .env
echo "Configure trusted proxies (this will enable reverse proxy functionality)? (Y/n)"
read -n1 configureTP
if [ "$configureTP" = "y" ] || [ "$configureTP" = "Y" ] || [ "$run" = "" ]; then
echo "Please enter a value (comma separated list of allowed IPs, * to allow all) for TRUSTED_PROXIES: [*]"
read -n1 configureTPval
if [ "$configureTPval" = "" ]; then
configureTPval="*"
fi
grep -q 'TRUSTED_PROXIES.*' .env && sed -i .env -e 's/TRUSTED_PROXIES.*/TRUSTED_PROXIES='$configureTPval'/' || printf "\nTRUSTED_PROXIES=$configureTPval\n" >> .env
fi
php artisan key:generate --force
echo "Running configuration scripts."
+2 -1
View File
@@ -1,5 +1,6 @@
[supervisord]
nodaemon=true
user=root
[program:cron]
process_name=%(program_name)s
@@ -10,7 +11,7 @@ user=root
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/pterodactyl/artisan queue:work database --queue=high,standard,low --sleep=3 --tries=3
command=php /var/www/html/pterodactyl/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
autostart=true
autorestart=true
user=pterodactyl
+2 -5
View File
@@ -1,18 +1,15 @@
#!/bin/ash
##
# This is an install script to quickly upgrade Pterodactyl Panel. Before running,
# please BACK UP any important data!
##
if [ "$(whoami)" != "pterodactyl" ]; then
echo "Rerunning script as webserver user."
exec su -c /usr/local/bin/upgrade pterodactyl
fi
echo "!!! PLEASE BACKUP ANY IMPORTANT DATA BEFORE UPGRADING !!!"
echo "Are you sure you want to continue the upgrade script? (Y/n)"
read -n1 run
if [ "$run" = "Y" ]; then
if [ "$run" = "y" ] || [ "$run" = "Y" ]; then
echo "Running upgrade script."
php artisan down