Skip to content

Commit 8fdee35

Browse files
committed
update docker stuff
1 parent 1327bbb commit 8fdee35

File tree

7 files changed

+25
-20
lines changed

7 files changed

+25
-20
lines changed

.dev/docker/default.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ server {
3131
location ~ \.php$ {
3232
fastcgi_split_path_info ^(.+\.php)(/.+)$;
3333
# the fastcgi_pass path needs to be changed accordingly when using CentOS
34-
fastcgi_pass unix:/var/run/php/php-fpm7.2.sock;
34+
fastcgi_pass 127.0.0.1:9000;
3535
fastcgi_index index.php;
3636
include fastcgi_params;
3737
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";

.dev/docker/default_ssl.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# If using Ubuntu this file should be placed in:
1+
# If using Ubuntu this file should be placed in:
22
# /etc/nginx/sites-available/
33
#
44
server {
@@ -49,7 +49,7 @@ server {
4949

5050
location ~ \.php$ {
5151
fastcgi_split_path_info ^(.+\.php)(/.+)$;
52-
fastcgi_pass unix:/var/run/php/php-fpm7.2.sock;
52+
fastcgi_pass 127.0.0.1:9000;
5353
fastcgi_index index.php;
5454
include fastcgi_params;
5555
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";

.dev/docker/entrypoint.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
cd /app
55

66
mkdir -p /var/log/panel/logs/ /var/log/supervisord/ /var/log/nginx/ /var/log/php7/ \
7-
&& rmdir /app/storage/logs/ \
7+
&& rm -rf /app/storage/logs/ \
88
&& chmod 777 /var/log/panel/logs/ \
99
&& ln -s /var/log/panel/logs/ /app/storage/
1010

1111
## check for .env file and generate app keys if missing
1212
if [ -f /app/var/.env ]; then
1313
echo "external vars exist."
14-
rm /app/.env
14+
rm -rf /app/.env
1515

1616
ln -s /app/var/.env /app/
1717
else
1818
echo "external vars don't exist."
19-
rm /app/.env
19+
rm -rf /app/.env
2020
touch /app/var/.env
2121

2222
## manually generate a key because key generate --force fails
@@ -31,12 +31,17 @@ fi
3131
echo "Checking if https is required."
3232
if [ -f /etc/nginx/conf.d/default.conf ]; then
3333
echo "Using nginx config already in place."
34+
if [ $LE_EMAIL ]; then
35+
echo "Checking for cert update"
36+
certbot certonly -d $(echo $APP_URL | sed 's~http[s]*://~~g') --standalone -m $LE_EMAIL --agree-tos -n
37+
else
38+
echo "No letsencrypt email is set"
39+
fi
3440
else
3541
echo "Checking if letsencrypt email is set."
3642
if [ -z $LE_EMAIL ]; then
37-
echo "No letsencrypt email is set Failing to http."
43+
echo "No letsencrypt email is set using http config."
3844
cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf
39-
4045
else
4146
echo "writing ssl config"
4247
cp .dev/docker/default_ssl.conf /etc/nginx/conf.d/default.conf

.dev/docker/supervisord.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
2020
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
2121

2222
[program:php-fpm]
23-
command=/usr/sbin/php-fpm7 -F
23+
command=/usr/local/sbin/php-fpm -F
2424
autostart=true
2525
autorestart=true
2626

2727
[program:queue-worker]
28-
command=/usr/bin/php /app/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
28+
command=/usr/local/bin/php /app/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
2929
user=nginx
3030
autostart=true
3131
autorestart=true

.dev/docker/www.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
[pterodactyl]
1+
[www]
22

33
user = nginx
44
group = nginx
55

6-
listen = /var/run/php/php-fpm7.2.sock
6+
listen = 127.0.0.1:9000
77
listen.owner = nginx
88
listen.group = nginx
99
listen.mode = 0750

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
FROM php:7.2-fpm-alpine
1+
FROM php:7.4-fpm-alpine
22

33
WORKDIR /app
44

5-
RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar unzip; \
5+
RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar unzip nginx libpng-dev libxml2-dev libzip-dev certbot; \
66
docker-php-ext-install bcmath; \
7-
apk add --no-cache libpng-dev; \
87
docker-php-ext-install gd; \
98
docker-php-ext-install mbstring; \
109
docker-php-ext-install pdo; \
1110
docker-php-ext-install pdo_mysql; \
1211
docker-php-ext-install tokenizer; \
13-
apk add --no-cache libxml2-dev; \
1412
docker-php-ext-install xml; \
13+
docker-php-ext-configure zip --with-libzip=/usr/include; \
1514
docker-php-ext-install zip; \
1615
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
1716

@@ -23,7 +22,8 @@ RUN cp .env.example .env \
2322
&& chown -R nginx:nginx . && chmod -R 777 storage/* bootstrap/cache
2423

2524
RUN cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf \
26-
&& cp .dev/docker/www.conf /etc/php7/php-fpm.d/www.conf \
25+
&& cat .dev/docker/www.conf > /usr/local/etc/php-fpm.d/www.conf \
26+
&& rm /usr/local/etc/php-fpm.d/www.conf.default \
2727
&& cat .dev/docker/supervisord.conf > /etc/supervisord.conf \
2828
&& echo "* * * * * /usr/bin/php /app/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
2929
&& sed -i s/ssl_session_cache/#ssl_session_cache/g /etc/nginx/nginx.conf \
@@ -33,4 +33,4 @@ EXPOSE 80 443
3333

3434
ENTRYPOINT ["/bin/ash", ".dev/docker/entrypoint.sh"]
3535

36-
CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]
36+
CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]

docker-compose.example.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '2'
22
services:
33
database:
4-
image: mariadb
4+
image: mariadb:10.4
55
volumes:
66
- "/srv/pterodactyl/database:/var/lib/mysql"
77
environment:
@@ -68,7 +68,7 @@ services:
6868
- "MAIL_PASSWORD=''"
6969
- "MAIL_ENCRYPTION=true"
7070
## certbot settings - Used to automatically generate ssl certs and
71-
- "LE_EMAIL=''" ## leave blank unless you aree generating certs.
71+
# - "LE_EMAIL=" ## uncomment if you are using ssl
7272

7373
networks:
7474
default:

0 commit comments

Comments
 (0)