update docker stuff
This commit is contained in:
parent
1327bbbbe5
commit
1995c2425e
6 changed files with 23 additions and 18 deletions
|
@ -31,7 +31,7 @@ server {
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||||
# the fastcgi_pass path needs to be changed accordingly when using CentOS
|
# the fastcgi_pass path needs to be changed accordingly when using CentOS
|
||||||
fastcgi_pass unix:/var/run/php/php-fpm7.2.sock;
|
fastcgi_pass 127.0.0.1:9000;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
|
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
|
||||||
|
|
|
@ -4,19 +4,19 @@
|
||||||
cd /app
|
cd /app
|
||||||
|
|
||||||
mkdir -p /var/log/panel/logs/ /var/log/supervisord/ /var/log/nginx/ /var/log/php7/ \
|
mkdir -p /var/log/panel/logs/ /var/log/supervisord/ /var/log/nginx/ /var/log/php7/ \
|
||||||
&& rmdir /app/storage/logs/ \
|
&& rm -rf /app/storage/logs/ \
|
||||||
&& chmod 777 /var/log/panel/logs/ \
|
&& chmod 777 /var/log/panel/logs/ \
|
||||||
&& ln -s /var/log/panel/logs/ /app/storage/
|
&& ln -s /var/log/panel/logs/ /app/storage/
|
||||||
|
|
||||||
## check for .env file and generate app keys if missing
|
## check for .env file and generate app keys if missing
|
||||||
if [ -f /app/var/.env ]; then
|
if [ -f /app/var/.env ]; then
|
||||||
echo "external vars exist."
|
echo "external vars exist."
|
||||||
rm /app/.env
|
rm -rf /app/.env
|
||||||
|
|
||||||
ln -s /app/var/.env /app/
|
ln -s /app/var/.env /app/
|
||||||
else
|
else
|
||||||
echo "external vars don't exist."
|
echo "external vars don't exist."
|
||||||
rm /app/.env
|
rm -rf /app/.env
|
||||||
touch /app/var/.env
|
touch /app/var/.env
|
||||||
|
|
||||||
## manually generate a key because key generate --force fails
|
## manually generate a key because key generate --force fails
|
||||||
|
@ -31,12 +31,17 @@ fi
|
||||||
echo "Checking if https is required."
|
echo "Checking if https is required."
|
||||||
if [ -f /etc/nginx/conf.d/default.conf ]; then
|
if [ -f /etc/nginx/conf.d/default.conf ]; then
|
||||||
echo "Using nginx config already in place."
|
echo "Using nginx config already in place."
|
||||||
|
if [ $LE_EMAIL ]; then
|
||||||
|
echo "Checking for cert update"
|
||||||
|
certbot certonly -d $(echo $APP_URL | sed 's~http[s]*://~~g') --standalone -m $LE_EMAIL --agree-tos -n
|
||||||
|
else
|
||||||
|
echo "No letsencrypt email is set"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Checking if letsencrypt email is set."
|
echo "Checking if letsencrypt email is set."
|
||||||
if [ -z $LE_EMAIL ]; then
|
if [ -z $LE_EMAIL ]; then
|
||||||
echo "No letsencrypt email is set Failing to http."
|
echo "No letsencrypt email is set using http config."
|
||||||
cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf
|
cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
else
|
else
|
||||||
echo "writing ssl config"
|
echo "writing ssl config"
|
||||||
cp .dev/docker/default_ssl.conf /etc/nginx/conf.d/default.conf
|
cp .dev/docker/default_ssl.conf /etc/nginx/conf.d/default.conf
|
||||||
|
|
|
@ -20,12 +20,12 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
|
serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket
|
||||||
|
|
||||||
[program:php-fpm]
|
[program:php-fpm]
|
||||||
command=/usr/sbin/php-fpm7 -F
|
command=/usr/local/sbin/php-fpm -F
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
|
|
||||||
[program:queue-worker]
|
[program:queue-worker]
|
||||||
command=/usr/bin/php /app/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
|
command=/usr/local/bin/php /app/artisan queue:work --queue=high,standard,low --sleep=3 --tries=3
|
||||||
user=nginx
|
user=nginx
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
[pterodactyl]
|
[www]
|
||||||
|
|
||||||
user = nginx
|
user = nginx
|
||||||
group = nginx
|
group = nginx
|
||||||
|
|
||||||
listen = /var/run/php/php-fpm7.2.sock
|
listen = 127.0.0.1:9000
|
||||||
listen.owner = nginx
|
listen.owner = nginx
|
||||||
listen.group = nginx
|
listen.group = nginx
|
||||||
listen.mode = 0750
|
listen.mode = 0750
|
||||||
|
|
10
Dockerfile
10
Dockerfile
|
@ -1,17 +1,16 @@
|
||||||
FROM php:7.2-fpm-alpine
|
FROM php:7.4-fpm-alpine
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar unzip; \
|
RUN apk add --no-cache --update ca-certificates dcron curl git supervisor tar unzip nginx libpng-dev libxml2-dev libzip-dev certbot; \
|
||||||
docker-php-ext-install bcmath; \
|
docker-php-ext-install bcmath; \
|
||||||
apk add --no-cache libpng-dev; \
|
|
||||||
docker-php-ext-install gd; \
|
docker-php-ext-install gd; \
|
||||||
docker-php-ext-install mbstring; \
|
docker-php-ext-install mbstring; \
|
||||||
docker-php-ext-install pdo; \
|
docker-php-ext-install pdo; \
|
||||||
docker-php-ext-install pdo_mysql; \
|
docker-php-ext-install pdo_mysql; \
|
||||||
docker-php-ext-install tokenizer; \
|
docker-php-ext-install tokenizer; \
|
||||||
apk add --no-cache libxml2-dev; \
|
|
||||||
docker-php-ext-install xml; \
|
docker-php-ext-install xml; \
|
||||||
|
docker-php-ext-configure zip --with-libzip=/usr/include; \
|
||||||
docker-php-ext-install zip; \
|
docker-php-ext-install zip; \
|
||||||
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||||||
|
|
||||||
|
@ -23,7 +22,8 @@ RUN cp .env.example .env \
|
||||||
&& chown -R nginx:nginx . && chmod -R 777 storage/* bootstrap/cache
|
&& chown -R nginx:nginx . && chmod -R 777 storage/* bootstrap/cache
|
||||||
|
|
||||||
RUN cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf \
|
RUN cp .dev/docker/default.conf /etc/nginx/conf.d/default.conf \
|
||||||
&& cp .dev/docker/www.conf /etc/php7/php-fpm.d/www.conf \
|
&& cat .dev/docker/www.conf > /usr/local/etc/php-fpm.d/www.conf \
|
||||||
|
&& rm /usr/local/etc/php-fpm.d/www.conf.default \
|
||||||
&& cat .dev/docker/supervisord.conf > /etc/supervisord.conf \
|
&& cat .dev/docker/supervisord.conf > /etc/supervisord.conf \
|
||||||
&& echo "* * * * * /usr/bin/php /app/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
|
&& echo "* * * * * /usr/bin/php /app/artisan schedule:run >> /dev/null 2>&1" >> /var/spool/cron/crontabs/root \
|
||||||
&& sed -i s/ssl_session_cache/#ssl_session_cache/g /etc/nginx/nginx.conf \
|
&& sed -i s/ssl_session_cache/#ssl_session_cache/g /etc/nginx/nginx.conf \
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
version: '2'
|
version: '2'
|
||||||
services:
|
services:
|
||||||
database:
|
database:
|
||||||
image: mariadb
|
image: mariadb:10.4
|
||||||
volumes:
|
volumes:
|
||||||
- "/srv/pterodactyl/database:/var/lib/mysql"
|
- "/srv/pterodactyl/database:/var/lib/mysql"
|
||||||
environment:
|
environment:
|
||||||
|
@ -68,7 +68,7 @@ services:
|
||||||
- "MAIL_PASSWORD=''"
|
- "MAIL_PASSWORD=''"
|
||||||
- "MAIL_ENCRYPTION=true"
|
- "MAIL_ENCRYPTION=true"
|
||||||
## certbot settings - Used to automatically generate ssl certs and
|
## certbot settings - Used to automatically generate ssl certs and
|
||||||
- "LE_EMAIL=''" ## leave blank unless you aree generating certs.
|
# - "LE_EMAIL=" ## uncomment if you are using ssl
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue