Commit 2528c50d authored by Cameron Carney's avatar Cameron Carney

Cleanup/idiot proofing

parent 11db638a
......@@ -2,10 +2,10 @@ FROM alpine:edge
MAINTAINER Cameron Carney <ccarney16@live.com>
ENV PANEL_VERSION=v0.6.0-rc.1
ENV STARTUP_TIMEOUT=15
ENV CONFIG_FILE=/data/pterodactyl.conf
ENV LOG_DIR=/data/logs/
ENV CONFIG_FILE=/data/pterodactyl.conf \
STARTUP_TIMEOUT=15 \
STORAGE_DIR=/data/storage \
PANEL_VERSION=v0.6.0-rc.1
WORKDIR /var/www/html
......@@ -14,7 +14,7 @@ RUN \
&& echo http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories \
&& echo http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories \
&& apk update \
&& apk add curl gettext nginx php7 php7 php7-bcmath php7-common php7-dom php7-fpm php7-gd \
&& apk add curl fcron gettext nginx php7 php7 php7-bcmath php7-common php7-dom php7-fpm php7-gd \
php7-memcached php7-mbstring php7-openssl php7-pdo php7-phar php7-json php7-pdo_mysql \
php7-session php7-tokenizer php7-ctype php7-zlib php7-zip supervisor \
&& mkdir -p /var/www/html /run/nginx
......@@ -23,7 +23,6 @@ RUN curl -Lo "${PANEL_VERSION}.tar.gz" https://github.com/Pterodactyl/Panel/arch
&& tar --strip-components=1 -xzvf ${PANEL_VERSION}.tar.gz \
&& rm "${PANEL_VERSION}.tar.gz" \
&& chmod -R 777 storage/* bootstrap/cache \
&& cp ./storage storage.template -rp \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer install --ansi --no-dev \
&& mv ./storage storage.template \
......
### Environment Variable List ###
---
__This is the full list of environment variables.___
#### Container Variables ####
---
* *PANEL_VERSION*: Panel Version the image is built against.
* *STARTUP_TIMEOUT*: Timeout in seconds before the panel starts (ignored when updating or dropping to shell).
* *CONFIG_FILE*: Location of the Configuration File.
* *STORAGE_DIR*: Location of storage/cache files.
#### WebServer Variables ####
---
* *SSL*: <True/False> Enables or Disables SSL.
* *SSL_CERT*: Location for the SSL Certificate.
* *SSL_CERT_KEY*: Location of the private key.
#### Panel Variables ####
---
* *PANEL_URL*: URL you want to use for the panel [required on startup].
* *TIMEZONE*:
* *CACHE_DRIVER*:
* *DB_HOST*:
* *DB_PORT*:
* *DB_DATABASE*:
* *DB_USERNAME*:
* *DB_PASSWORD*:
* *MAIL_DRIVER*:
* *MAIL_EMAIL*:
* *MAIL_FROM_NAME*:
__*Memcached Only Options*__
* *MEMCACHED_HOST*:
* *MEMCACHED_PORT*:
\ No newline at end of file
# Pterodactyl Panel Dockerfile #
#### Free and Open Source Agnostic Game Panel ####
__A Free and Open Source Agnostic Game Panel__
### Usage ###
This Github Repository provides a docker-compose.yml for an easy to start environment.
---
Docker: `docker run --name=pterodactyl-panel -p 80:80 -p 443:443 --env-file=./.env quay.io/ccarney/pterodactyl-panel:v0.6.0-rc.1`
Docker: `docker --name=pterodactyl-panel -e PANEL_URL=localhost run quay.io/ccarney/pterodactyl-panel:v0.6.0-rc.1`*
__or__
Docker Compose: `docker-compose up`
Please refer to ENVIRIONMENT.txt for more information regarding environment variables.
Please refer to ENVIRIONMENT.md for more information regarding environment variables.
### Docker Compose ###
---
This repo provides a template docker-compose.yml file for easier deployment for the panel. It is highly recommended to use over straight up Docker.
### Updating ###
---
__Minor Revisions & Configuration Changes:__
Docker: `docker run --rm -v <root>:/data --env-file=./.env quay.io/ccarney/pterodactyl-panel:v0.6.0 p:update`
Docker Compose: `docker-compose run --rm panel p:update`
__From v0.5.x to v0.6.x:__
*TBA...*
### SSL Encryption ###
---
SSL Encryption is an optional but recommended feature. Automatic SSL is provided by Let's Encrypt. When using the webroot feature in certbot (refer to docker-compose.yml), you should mount the .well-known directory created to `/var/www/html/.well-known` within the panel container.
### Contributing ###
---
All issues regarding Pterodactyl Panel/Node are to be reported to https://github.com/Pterodactyl/Panel/issues.
\ No newline at end of file
##### Notes #####
\ No newline at end of file
......@@ -42,7 +42,7 @@ services:
- cache
- mysql
environment:
- PANEL_URL=localhost
- PANEL_URL=http://localhost/
# SSL Encryption, useful if you dont run behind a reverse proxy
- SSL=false
......
......@@ -16,16 +16,18 @@ function init {
echo "Starting Pterodactyl ${PANEL_VERSION} in ${STARTUP_TIMEOUT} seconds..."
sleep ${STARTUP_TIMEOUT}
DOMAIN_NAME="$(echo $PANEL_URL | awk -F/ '{print $3}')"
# Checks if we have SSL enabled or not, and updates the configuration to what is desired.
if [ "${SSL}" == "true" ]; then
echo "Enabling SSL"
envsubst '${PANEL_URL},${SSL_CERT},${SSL_CERT_KEY}' \
envsubst '${DOMAIN_NAME},${SSL_CERT},${SSL_CERT_KEY}' \
< /etc/nginx/templates/https.conf.tmpl > /etc/nginx/conf.d/default.conf
else
echo "Disabling SSL"
envsubst '${PANEL_URL}' \
envsubst '${DOMAIN_NAME}' \
< /etc/nginx/templates/http.conf.tmpl > /etc/nginx/conf.d/default.conf
fi
......@@ -36,12 +38,12 @@ function init {
function initConfig {
# Create the storage directory
if [ ! -d /data/storage ]; then
cp ./storage.template /data/storage -pr
if [ ! -d ${STORAGE_DIR} ]; then
cp ./storage.template ${STORAGE_DIR} -pr
fi
rm -rf ./storage
ln -s /data/storage ./storage
ln -s ${STORAGE_DIR} ./storage
# Always destroy .env on startup
rm .env -rf
......
server {
listen 80;
listen [::]:80;
server_name ${PANEL_URL};
server_name ${DOMAIN_NAME};
root /var/www/html/public;
index index.php;
......
server {
listen 80;
listen [::]:80;
server_name ${PANEL_URL};
server_name ${DOMAIN_NAME};
# enforce https
location ^ /.well-known {
......@@ -16,7 +16,7 @@ server {
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ${PANEL_URL};
server_name ${DOMAIN_NAME};
root /var/www/html/public;
index index.php;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment