Skip to content

Commit 987e310

Browse files
authored
Update the local development environment (#22)
1 parent 1af4814 commit 987e310

File tree

22 files changed

+385
-294
lines changed

22 files changed

+385
-294
lines changed

.github/workflows/panel.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
1-
name: Panel
2-
1+
name: panel
32
on:
3+
workflow_dispatch:
44
push:
55
branches:
6-
- 'master'
7-
6+
- master
7+
permissions:
8+
packages: write
89
jobs:
910
build-and-push:
1011
name: Build and Push
1112
runs-on: ubuntu-latest
1213
steps:
13-
- uses: actions/checkout@v2
14-
- uses: docker/setup-qemu-action@v1
15-
- uses: docker/setup-buildx-action@v1
16-
- uses: docker/login-action@v1
14+
- uses: actions/checkout@v4
15+
- uses: docker/setup-qemu-action@v3
16+
- uses: docker/setup-buildx-action@v3
17+
- uses: docker/login-action@v3
1718
with:
1819
registry: ghcr.io
1920
username: ${{ github.repository_owner }}
20-
password: ${{ secrets.REGISTRY_TOKEN }}
21-
22-
- name: Build and Push image
23-
uses: docker/build-push-action@v2
21+
password: ${{ secrets.GITHUB_TOKEN }}
22+
- uses: docker/build-push-action@v6
2423
with:
2524
push: true
25+
file: ./build/panel/Dockerfile
2626
platforms: linux/amd64,linux/arm64
27-
context: build/panel
2827
tags: ghcr.io/pterodactyl/development/panel:latest

.github/workflows/wings.yaml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
1-
name: Wings
2-
1+
name: wings
32
on:
3+
workflow_dispatch:
44
push:
55
branches:
6-
- 'master'
7-
6+
- master
7+
permissions:
8+
packages: write
89
jobs:
910
build-and-push:
10-
name: Build and Push
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: docker/setup-qemu-action@v1
15-
- uses: docker/setup-buildx-action@v1
16-
- uses: docker/login-action@v1
13+
- uses: actions/checkout@v4
14+
- uses: docker/setup-qemu-action@v3
15+
- uses: docker/setup-buildx-action@v3
16+
- uses: docker/login-action@v3
1717
with:
1818
registry: ghcr.io
1919
username: ${{ github.repository_owner }}
20-
password: ${{ secrets.REGISTRY_TOKEN }}
21-
22-
- name: Build and Push image
23-
uses: docker/build-push-action@v2
20+
password: ${{ secrets.GITHUB_TOKEN }}
21+
- uses: docker/build-push-action@v6
2422
with:
2523
push: true
24+
file: ./build/wings/Dockerfile
2625
platforms: linux/amd64,linux/arm64
27-
context: build/wings
28-
tags: ghcr.io/pterodactyl/development/wings:latest
26+
tags: ghcr.io/pterodactyl/development/wings:latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
**/.DS_Store
22
.idea
3+
.nvmrc
34

45
docker/certificates/*
56
!docker/certificates/.gitkeep

build/panel/Dockerfile

Lines changed: 53 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,71 @@
1-
FROM debian:11-slim
1+
FROM debian:12-slim
22

33
LABEL maintainer="[email protected]" \
44
description="Local development environment for Pterodactyl Panel." \
55
org.opencontainers.image.source=https://github.com/pterodactyl/development
66

7-
ENV DEBIAN_FRONTEND noninteractive
8-
ENV LANG=C.UTF-8
7+
ARG TARGETARCHI
8+
ARG TARGETPLATFORM
9+
ARG BUILDPLATFORM
10+
ARG PHP_VERSION=8.2
11+
12+
ENV DEBIAN_FRONTEND=noninteractive \
13+
LANG=C.UTF-8 \
14+
LC_ALL=C.UTF-8 \
15+
PHP_VERSION=$PHP_VERSION \
16+
PHP=php$PHP_VERSION
917

1018
USER root
1119
RUN apt -y update \
12-
&& apt -y --no-install-recommends install lsb-release ca-certificates apt-transport-https software-properties-common gnupg2 curl sudo \
13-
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
14-
&& curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
15-
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
16-
&& echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | tee /etc/apt/sources.list.d/sury-php.list \
17-
&& curl -sL https://packages.sury.org/php/apt.gpg | apt-key add - \
20+
&& apt -y --no-install-recommends install ca-certificates apt-transport-https software-properties-common \
21+
gnupg2 curl sudo locales nginx unzip git supervisor cron default-mysql-client \
22+
iproute2 iputils-ping tar nano \
23+
&& curl -sL https://deb.nodesource.com/setup_22.x | bash - \
24+
&& curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/sury-keyring.gpg \
25+
&& echo "deb [signed-by=/etc/apt/trusted.gpg.d/sury-keyring.gpg] https://packages.sury.org/php/ bookworm main" | tee /etc/apt/sources.list.d/sury-php.list \
1826
&& apt -y update \
19-
&& apt -y upgrade \
20-
&& apt -y --no-install-recommends install \
21-
locales \
22-
iproute2 \
23-
iputils-ping \
24-
lsb-release \
25-
nginx \
26-
tar \
27-
unzip \
28-
git \
29-
supervisor \
30-
cron \
31-
nodejs \
32-
yarn \
33-
nano \
34-
&& apt -y --no-install-recommends install php8.1 \
35-
php8.1-cli \
36-
php8.1-common \
37-
php8.1-gd \
38-
php8.1-mysql \
39-
php8.1-mbstring \
40-
php8.1-bcmath \
41-
php8.1-xml \
42-
php8.1-fpm \
43-
php8.1-curl \
44-
php8.1-zip \
45-
php8.1-xdebug \
46-
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
27+
&& apt -y --no-install-recommends install nodejs \
28+
php8.2 \
29+
php8.2-cli \
30+
php8.2-common \
31+
php8.2-gd \
32+
php8.2-mysql \
33+
php8.2-mbstring \
34+
php8.2-bcmath \
35+
php8.2-xml \
36+
php8.2-fpm \
37+
php8.2-curl \
38+
php8.2-zip \
39+
php8.2-xdebug \
4740
&& apt autoremove -y \
48-
&& rm -rf /var/lib/apt/lists/*
49-
50-
COPY entrypoint /usr/local/bin/entrypoint
51-
COPY setup-pterodactyl /usr/local/bin/setup-pterodactyl
52-
COPY configs/supervisord.conf /etc/supervisord.conf
53-
COPY configs/pterodactyl.conf /etc/nginx/sites-available/pterodactyl.conf
41+
&& apt clean \
42+
&& rm -rf /var/cache/apt/archives /var/cache/debconf /var/lib/apt/lists
5443

55-
RUN useradd -m pterodactyl \
56-
&& usermod -a -g www-data -G sudo pterodactyl \
57-
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/sudoers \
58-
&& chmod +x /usr/local/bin/setup-pterodactyl \
59-
&& chmod +x /usr/local/bin/entrypoint \
44+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
45+
&& npm i -g pnpm \
6046
&& rm -rf /etc/nginx/sites-enabled/* \
61-
&& ln -s /etc/nginx/sites-available/pterodactyl.conf /etc/nginx/sites-enabled/ \
62-
&& phpdismod -s cli xdebug \
6347
&& mkdir -p /var/run/php \
6448
&& mkdir -p /var/www/html \
65-
&& (crontab -l 2>/dev/null; echo "* * * * * php /var/www/html/artisan schedule:run >> /dev/null 2>&1") | crontab -
49+
&& sed -i 's/;daemonize = yes/daemonize = no/' /etc/php/$PHP_VERSION/fpm/php-fpm.conf \
50+
&& useradd -m pterodactyl \
51+
&& usermod -a -g www-data -G sudo pterodactyl \
52+
&& echo "%sudo ALL=(ALL:ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/sudoers \
53+
&& phpdismod xdebug \
54+
&& rm -rf /tmp/*
6655

67-
WORKDIR /var/www/html
56+
COPY ./build/panel/php/99-pool.conf /etc/php/$PHP_VERSION/fpm/pool.d/99-pool.conf
57+
COPY ./build/panel/php/99-pterodactyl.ini /etc/php/$PHP_VERSION/shared.d/99-pterodactyl.ini
58+
COPY ./build/panel/configs/pterodactyl.conf /etc/nginx/sites-available/pterodactyl.conf
6859

69-
EXPOSE 80
70-
EXPOSE 8080
60+
RUN (crontab -l 2>/dev/null; echo "* * * * * php /var/www/html/artisan schedule:run >> /dev/null 2>&1") | crontab - \
61+
&& ln -s /etc/nginx/sites-available/pterodactyl.conf /etc/nginx/sites-enabled/ \
62+
&& ln -s /etc/php/$PHP_VERSION/shared.d/99-pterodactyl.ini /etc/php/$PHP_VERSION/fpm/99-pterodactyl.ini \
63+
&& ln -s /etc/php/$PHP_VERSION/shared.d/99-pterodactyl.ini /etc/php/$PHP_VERSION/cli/99-pterodactyl.ini \
64+
&& mv /etc/php/$PHP_VERSION/fpm/pool.d/www.conf /etc/php/$PHP_VERSION/fpm/pool.d/10-www.conf
7165

66+
COPY ./build/panel/configs/supervisor /etc/supervisor
67+
COPY --chmod=700 ./build/panel/scripts/* /usr/local/bin
68+
69+
EXPOSE 80 8080
70+
WORKDIR /var/www/html
7271
ENTRYPOINT ["entrypoint"]

build/panel/configs/pterodactyl.conf

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
server {
2-
listen 80;
2+
listen 8080 default_server;
33
server_name pterodactyl.test;
44

55
root /var/www/html/public;
66
index index.html index.htm index.php;
77
charset utf-8;
88

9+
access_log off;
10+
error_log /dev/stderr error;
11+
12+
gzip on;
13+
gzip_comp_level 6;
14+
gzip_types text/plain text/css application/json application/javascript text/javascript text/xml application/xml;
15+
16+
sendfile off;
17+
client_max_body_size 100m;
18+
client_body_timeout 120s;
19+
920
location / {
1021
try_files $uri $uri/ /index.php?$query_string;
1122
}
1223

1324
location = /favicon.ico { access_log off; log_not_found off; }
1425
location = /robots.txt { access_log off; log_not_found off; }
1526

16-
access_log off;
17-
error_log /var/log/nginx/error.log error;
18-
19-
client_max_body_size 100m;
20-
client_body_timeout 120s;
21-
22-
sendfile off;
23-
2427
add_header X-Content-Type-Options nosniff;
2528
add_header X-XSS-Protection "1; mode=block";
2629
add_header X-Robots-Tag none;
@@ -29,19 +32,13 @@ server {
2932
add_header Referrer-Policy same-origin;
3033

3134
location ~ \.php$ {
32-
fastcgi_split_path_info ^(.+\.php)(/.+)$;
33-
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
34-
fastcgi_index index.php;
35-
include fastcgi_params;
35+
include snippets/fastcgi-php.conf;
36+
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
37+
3638
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
37-
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
3839
fastcgi_param HTTP_PROXY "";
39-
fastcgi_intercept_errors off;
40-
fastcgi_buffer_size 16k;
41-
fastcgi_buffers 4 16k;
42-
fastcgi_connect_timeout 300;
43-
fastcgi_send_timeout 300;
44-
fastcgi_read_timeout 300;
40+
fastcgi_param HTTPS "on";
41+
fastcgi_buffer_size 8k;
4542
}
4643

4744
location ~ /\.ht {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[program:php-fpm]
2+
command=/usr/sbin/php-fpm8.2 -F
3+
autostart=true
4+
autorestart=true
5+
priority=5
6+
stdout_logfile=/dev/stdout
7+
stdout_logfile_maxbytes=0
8+
stderr_logfile=/dev/stderr
9+
stderr_logfile_maxbytes=0
10+
11+
[program:nginx]
12+
command=/usr/sbin/nginx -g 'daemon off;'
13+
autostart=true
14+
autorestart=true
15+
priority=10
16+
stdout_logfile=/dev/stdout
17+
stdout_logfile_maxbytes=0
18+
stderr_logfile=/dev/stderr
19+
stderr_logfile_maxbytes=0
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[program:worker]
2+
process_name=%(program_name)s_%(process_num)02d
3+
numprocs=2
4+
user=www-data
5+
autostart=true
6+
autorestart=true
7+
startretries=5
8+
command=/usr/bin/php /var/www/html/artisan queue:listen --backoff=1 --tries=1 -v
9+
stdout_logfile=/dev/stdout
10+
stdout_logfile_maxbytes=0
11+
stderr_logfile=/dev/stderr
12+
stderr_logfile_maxbytes=0
13+
14+
[program:cron]
15+
process_name=%(program_name)s
16+
user=root
17+
command=/usr/sbin/cron -f
18+
autostart=true
19+
autorestart=true
20+
startretries=3
21+
stdout_logfile=/dev/stdout
22+
stdout_logfile_maxbytes=0
23+
stderr_logfile=/dev/stderr
24+
stderr_logfile_maxbytes=0
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[supervisord]
2+
user=root
3+
nodaemon=true
4+
logfile=/dev/null
5+
logfile_maxbytes=0
6+
pidfile=/var/run/supervisord.pid
7+
8+
[supervisorctl]
9+
serverurl=unix:///var/run/supervisor.sock
10+
11+
[unix_http_server]
12+
file=/var/run/supervisor.sock
13+
14+
[rpcinterface:supervisor]
15+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
16+
17+
[include]
18+
files = /etc/supervisor/conf.d/*.conf

build/panel/configs/supervisord.conf

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)