Commit a734f95c authored by Cameron Carney's avatar Cameron Carney

Reorganizing container/repo

parent 52b1f436
##
# Example environment variables
##
# MySQL Settings, These can be deleted if you don't use docker-compose.other.yml
MYSQL_ROOT_PASSWORD=apassword
MYSQL_DATABASE=pterodactyl
MYSQL_USER=ptero
MYSQL_PASSWORD=pterodbpass
# Please change this to something else or routing will not work correctly.
APP_URL=http://localhost/
##
# Webserver Variables
##
# SSL Encryption, useful if you dont run behind a reverse proxy
SSL=false
SSL_CERT=/certs/live/localhost/fullchain.pem
SSL_CERT_KEY=/certs/live/localhost/privkey.pem
# Panel Variables, These are only needed when doing initial setup.
# When doing migration, the container will attempt to get the environment
# variables from the .env file.
##
# Panel Variables
# These variables can be used within pterodactyl.conf (.env when symlinked
# into the docker webroot). These variables are also set via pterodactyl:env
# and pterodactyl:mail.
##
APP_URL=http://localhost/
TIMEZONE=UTC
CACHE_DRIVER=memcached
......
### 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 ####
---
__*General Webserver Options*__
* *UPLOAD_LIMIT*: Limit the size a user is allowed to upload through the webserver (default 100mb)
__*Security Options*__
* *SSL*: <True/False> Enables or Disables SSL.
* *SSL_CERT*: Location for the SSL Certificate.
* *SSL_CERT_KEY*: Location of the private key.
#### Panel Variables ####
---
* *APP_URL*: URL you want to use for the panel [required on startup].
* *TIMEZONE*:
* *CACHE_DRIVER*:
__*Database Options*__
* *DB_HOST*:
* *DB_PORT*:
* *DB_DATABASE*:
* *DB_USERNAME*:
* *DB_PASSWORD*:
__*Mailing Options*__
* *MAIL_DRIVER*:
* *MAIL_FROM*:
* *MAIL_FROM_NAME*:
__*Memcached Only Options*__
* *MEMCACHED_HOST*:
* *MEMCACHED_PORT*:
\ No newline at end of file
......@@ -4,16 +4,16 @@
[![Docker Repository on Quay](https://quay.io/repository/ccarney/pterodactyl-panel/status "Docker Repository on Quay")](https://quay.io/repository/ccarney/pterodactyl-panel)
This is a docker image for pterodactyl panel, NOT the official panel repository!
Pterodactyl, a free an open source agnostic game panel... In a Container!
## Quick Start
Copy .env.example as .env and run the setup under the commands provided:
Copy and modify the contents of *.env.example* to *.env* and run the setup under the commands provided:
*Docker*:
You can run the panel using this command:
`docker run --name=pterodactyl-panel -p 80:80 -p 443:443 --env-file=./.env quay.io/ccarney/pterodactyl-panel:v0.6.4`.
`docker run --name=pterodactyl-panel -p 80:80 -p 443:443 -v data:/data --env-file=./.env quay.io/ccarney/pterodactyl-panel:{version}`
><small>This command alone does not provide the full environment for the panel. This is more or less a reference. If you wish to have a full environment, it is recommended to use the method below.</small>
......@@ -22,13 +22,11 @@ __or__ *Docker Compose*:
A *docker-compose.yml* file is provided for anyone who uses docker compose.
You can start the panel by running `docker-compose up -d`.
*docker-compose.other.yml* provides mysql and the Let's Encrypt certbot services. If you want to use those services, you can symlink or copy it as *docker-compose.override.yml*.
## The _/data_ Volume
The data volume for the image is used to maintain persistence:
* *pterodactyl.conf*: The .env file for laravel, automatically generated if missing on startup. It is recommended not to modify this and instead use environmental variables instead.
* *pterodactyl.conf*: The .env file for laravel, automatically generated if missing on server startup. This file is only used if a variable is not provided by the container.
* *storage/*: Laravel storage, contains cache, logs, and files that need to be writable to the panel.
* *cache/*: configuration cache for the panel.
......@@ -42,10 +40,6 @@ Refer to https://docs.pterodactyl.io/ when updating to a newer version. `php art
Refer to [https://docs.pterodactyl.io/](https://docs.pterodactyl.io/) for migrating. For users who are coming from a non dockerized setup, you can put your panel .env within the */data* volume and rename it as pterodactyl.conf. Once all set, start up the container environment.
## Entrypoint Commands
* p:start - Starts the panel web server and requirements (We don't provide cache and database!).
## SSL Encryption
SSL Encryption is an optional but recommended feature. Automatic SSL within *docker-compose.other.yml* is provided by Let's Encrypt. Refer to *docker-compose.other.yml* for more information.
......@@ -69,4 +63,3 @@ All issues regarding Pterodactyl Panel/Node are to be reported to https://github
[https://docs.docker.com/](https://hub.docker.com/)
[https://hub.docker.com/](https://hub.docker.com/)
##
# Optional Services, Recommended to rename to docker-compose.override.yml
##
version: '2'
services:
##
# On initial setup, run "docker-compose run --rm certbot certonly --webroot -w /ssl/.webroot
# -d <domain>" to recieve a certificate
##
# certbot:
# command: renew
# image: certbot/certbot:v1.13.0
# volumes:
# - ./ssl:/etc/letsencrypt
##
# If you rely on another MySQL/MariaDB instance, this can be safely removed.
# Make sure to remove the dependency from the panel
##
mysql:
env_file: .env
volumes:
- ./db:/var/lib/mysql
image: mariadb:10.1
panel:
depends_on:
- mysql
volumes:
- ./ssl:/ssl
- ./ssl/.webroot/.well-known:/var/www/html/public/.well-known
ports:
- 80:80
- 443:443
##
# If you don't plan on running the daemon on the same machine,
# you may comment the section below.
##
daemon:
image: quay.io/ccarney/pterodactyl-daemon:v0.4.3
depends_on:
- panel
ports:
- 8080:8080
restart: always
volumes:
- /srv/daemon/config:/srv/daemon/config
- /srv/daemon/packs:/srv/daemon/packs
- /srv/daemon/scripts:/srv/daemon/scripts
- /srv/daemon-data:/srv/daemon-data
- /tmp/pterodactyl:/tmp/pterodactyl
- /var/run/docker.sock:/var/run/docker.sock
......@@ -4,23 +4,85 @@
version: '2'
services:
##
# Let's Encrypt Certbot
# This service provides free SSL certificates that can
# be used to connect to the world. Uncomment if you
# are using the panel on its own (without a reverse
# proxy). It is recommended to use the webroot
# plugin. To get a certificate, run
# "docker-compose run --rm certbot --webroot -w
# /etc/letsencrypt/.webroot -d {domain}" and follow
# the instructions on screen.
##
# certbot:
# command: renew
# image: certbot/certbot:v1.13.0
# volumes:
# - ./letsencrypt:/etc/letsencrypt
##
# Panel Cache
# This service is required for the panel to function.
# You can use either redis or memcached, but memcached
# is provided by default here.
##
cache:
image: memcached:1.4-alpine
restart: always
##
# The main service.
# Ensure that all variables/data is correct.
# MariaDB (MySQL) Server
# If you rely on another MySQL/MariaDB instance,
# this can be safely removed. If you want to have
# your game servers be able to access this, be sure
# to declare your ports.
##
mysql:
env_file: .env
volumes:
- ./db:/var/lib/mysql
image: mariadb:10.1
##
# Pterodactyl Panel
# This is the main service that will be seen publically.
##
panel:
container_name: pterodactyl-panel
depends_on:
- cache
- mysql
env_file: .env
image: quay.io/ccarney/pterodactyl-panel:v0.6.4
restart: always
volumes:
- ./data:/data
# Let's Encrypt webroot functionality
# - ./letsencrypt:/etc/letsencrypt
# - ./letsencrypt/.webroot/.well-known:/var/www/html/public
ports:
- 80:80
- 443:443
##
# Pterodactyl Daemon
# If you don't plan on running the daemon on the same machine,
# you may comment the section below.
##
daemon:
image: quay.io/ccarney/pterodactyl-daemon:v0.4.3
depends_on:
- panel
ports:
- 8080:8080
restart: always
volumes:
- /srv/daemon/config:/srv/daemon/config
- /srv/daemon/packs:/srv/daemon/packs
- /srv/daemon/scripts:/srv/daemon/scripts
- /srv/daemon-data:/srv/daemon-data
- /tmp/pterodactyl:/tmp/pterodactyl
- /var/run/docker.sock:/var/run/docker.sock
......@@ -29,10 +29,6 @@ function init {
# Runs the initial configuration on every startup
function startServer {
if [[ -z "${APP_URL}" ]]; then
echo "Missing environment variable 'APP_URL'! Please resolve it now and start the container back up..."
exit 1;
fi
# Initial setup
if [ ! -e "${CONFIG_FILE}" ]; then
......@@ -68,10 +64,6 @@ function startServer {
echo "Starting Pterodactyl ${PANEL_VERSION}..."
fi
# Since Nginx does not support URL's, lets just pull the domain out of the URL
export DOMAIN_NAME="$(echo $APP_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"
......
server {
listen 80;
listen [::]:80;
server_name ${DOMAIN_NAME};
listen 80 default;
listen [::]:80 default;
root /var/www/html/public;
index index.php;
......
server {
listen 80;
listen [::]:80;
server_name ${DOMAIN_NAME};
# enforce https
listen 80 default;
listen [::]:80 default;
# enforce https
location ^~ /.well-known {
alias /var/www/html/public/.well-known;
}
location / {
return 301 https://$server_name$request_uri;
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name ${DOMAIN_NAME};
listen 443 ssl http2 default;
listen [::]:443 ssl http2 default;
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