diff --git a/README.md b/README.md index b61a6c8..9a7227d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # 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) > 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 @@ -6,37 +7,42 @@ services, such as Minecraft and Teamspeak servers. Setting it up, however, takes quite a few steps according to the [documentation](https://docs.pterodactyl.io/docs). This Docker Compose configuration is aimed at removing a majority of the steps so -that the installation process is almost as simple as cloning this build script and +that the installation process is *almost* as simple as cloning this build script and running `docker-compose up`. There are other Docker Compose setups available, including the [one](https://github.com/parkervcp/pterodactyl-panel-Dockerfile) -created by one of the project's primary developers, parkervcp. However, I opted -to create my own for a few reasons: +created by one of the project's primary developers, parkervcp. This differs from +those setups in various ways for a couple of different reasons: -1. These setups detract from Docker's "one service per container" philosophy. While -it might be impossible to completely narrow down such a complex setup to one container, -there are services, such as PHP and Nginx, that can be separated. -2. I wanted to add a few alternative services for use in the Panel, such as Nginx -instead of caddy. +1. This setup splits the HTTP and PHP services into two different containers. Doing +so allows for separation of concerns (a central Docker principle) and easier management +of containers and Dockerfiles. +2. This setup uses Nginx instead of Caddy. Various [benchmarks](https://community.centminmod.com/threads/caddy-http-2-server-benchmarks.5170/#post-34367) +[indicate](https://hackernoon.com/caddy-a-modern-web-server-vs-nginx-e9e4abc443e) +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. ## Usage The instructions are fairly self explanatory: clone the repository and launch the -stack. +project. Instructions on how to launch the project are listed below. All commands +should be run from the repository directory. + +In your favorite text editor, open docker-compose.yml change the port that you want +the panel binded to. See below for more details. Once that's done, build and start +the project. ``` -git clone https://github.com/TehTotalPwnage/pterodactyl-panel-docker mypanel -cd mypanel +docker-compose -p pull +docker-compose -p build +docker-compose -p up ``` -I'd recommend cloning the repository into a specific directory name unless you want -all your containers to be named pterodactylpaneldocker_service_number. +The panel is now online. If this is your first time booting the panel, you'll also +need to run the install script, which will run all of the necessary configuration +scripts and database migrations for you. ``` -vim docker-compose.yml -``` -In your favorite text editor, change the port that you want the panel binded to. -There are other settings you may need to modify that are documented below. -``` -docker-compose pull -docker-compose build -docker-compose up +docker exec -it _php_1 install +# Restart the panel to load changes. The install script will remind you to do so. +docker restart _php_1 ``` The panel should now be ready, and you can connect to it via localhost at the port you specified in the Docker Compose file. @@ -47,22 +53,72 @@ ports: ``` :80 ``` -For the Panel, there are different environment variables that you can configure: -- `panel_url` - The FQDN that the Panel will be hosted on. Required. (https://mc.example.com) -- `timezone` - The timezone that the Panel will be hosted on. A list is available at http://php.net/manual/en/timezones.php. -- `email_driver` - The email driver for the Panel. Options are smtp, mail, mailgun, mandrill, or postmark. -- `panel_email` - The email address the panel should use. Required for all drivers. -- `email_name` - The display name emails sent should have. Required for all drivers. -- `email_user` - A username for the email server. Required for smtp, mandrill, mailgun, and postmark. -- `email_pass` - A password for the email server. Required for smtp. -- `email_domain` - The domain the driver should connect to. Required for smtp and mailgun. -- `email_port` - The port of the email server. Required for smtp. -- `admin_email` - The email address for the admin user. Required. -- `admin_first` - The first name for the admin user. Required. -- `admin_last` - The last name for the admin user. Required. -- `admin_pass` - The password for the admin user. Required. -- `admin_username` - The username for the admin user. Required. +Two scripts are provided in order to aid with installation and upgrades. +``` +# Use these scripts with the following command: +docker exec -it _php_1