update docker stuff
This commit is contained in:
parent
1327bbbbe5
commit
8fdee3554c
7 changed files with 25 additions and 20 deletions
|
@ -31,7 +31,7 @@ server {
|
|||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
# 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;
|
||||
include fastcgi_params;
|
||||
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# If using Ubuntu this file should be placed in:
|
||||
# If using Ubuntu this file should be placed in:
|
||||
# /etc/nginx/sites-available/
|
||||
#
|
||||
server {
|
||||
|
@ -49,7 +49,7 @@ server {
|
|||
|
||||
location ~ \.php$ {
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:/var/run/php/php-fpm7.2.sock;
|
||||
fastcgi_pass 127.0.0.1:9000;
|
||||
fastcgi_index index.php;
|
||||
include fastcgi_params;
|
||||
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
|
||||
|
|
|
@ -4,19 +4,19 @@
|
|||
cd /app
|
||||
|
||||
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/ \
|
||||
&& ln -s /var/log/panel/logs/ /app/storage/
|
||||
|
||||
## check for .env file and generate app keys if missing
|
||||
if [ -f /app/var/.env ]; then
|
||||
echo "external vars exist."
|
||||
rm /app/.env
|
||||
rm -rf /app/.env
|
||||
|
||||
ln -s /app/var/.env /app/
|
||||
else
|
||||
echo "external vars don't exist."
|
||||
rm /app/.env
|
||||
rm -rf /app/.env
|
||||
touch /app/var/.env
|
||||
|
||||
## manually generate a key because key generate --force fails
|
||||
|
@ -31,12 +31,17 @@ fi
|
|||
echo "Checking if https is required."
|
||||
if [ -f /etc/nginx/conf.d/default.conf ]; then
|
||||
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
|
||||
echo "Checking if letsencrypt email is set."
|
||||
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
|
||||
|
||||
else
|
||||
echo "writing ssl config"
|
||||
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
|
||||
|
||||
[program:php-fpm]
|
||||
command=/usr/sbin/php-fpm7 -F
|
||||
command=/usr/local/sbin/php-fpm -F
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
||||
[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
|
||||
autostart=true
|
||||
autorestart=true
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
[pterodactyl]
|
||||
[www]
|
||||
|
||||
user = nginx
|
||||
group = nginx
|
||||
|
||||
listen = /var/run/php/php-fpm7.2.sock
|
||||
listen = 127.0.0.1:9000
|
||||
listen.owner = nginx
|
||||
listen.group = nginx
|
||||
listen.mode = 0750
|
||||
|
|
12
Dockerfile
12
Dockerfile
|
@ -1,17 +1,16 @@
|
|||
FROM php:7.2-fpm-alpine
|
||||
FROM php:7.4-fpm-alpine
|
||||
|
||||
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; \
|
||||
apk add --no-cache libpng-dev; \
|
||||
docker-php-ext-install gd; \
|
||||
docker-php-ext-install mbstring; \
|
||||
docker-php-ext-install pdo; \
|
||||
docker-php-ext-install pdo_mysql; \
|
||||
docker-php-ext-install tokenizer; \
|
||||
apk add --no-cache libxml2-dev; \
|
||||
docker-php-ext-install xml; \
|
||||
docker-php-ext-configure zip --with-libzip=/usr/include; \
|
||||
docker-php-ext-install zip; \
|
||||
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
|
||||
|
||||
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 \
|
||||
&& 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 \
|
||||
|
@ -33,4 +33,4 @@ EXPOSE 80 443
|
|||
|
||||
ENTRYPOINT ["/bin/ash", ".dev/docker/entrypoint.sh"]
|
||||
|
||||
CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]
|
||||
CMD [ "supervisord", "-n", "-c", "/etc/supervisord.conf" ]
|
|
@ -1,7 +1,7 @@
|
|||
version: '2'
|
||||
services:
|
||||
database:
|
||||
image: mariadb
|
||||
image: mariadb:10.4
|
||||
volumes:
|
||||
- "/srv/pterodactyl/database:/var/lib/mysql"
|
||||
environment:
|
||||
|
@ -68,7 +68,7 @@ services:
|
|||
- "MAIL_PASSWORD=''"
|
||||
- "MAIL_ENCRYPTION=true"
|
||||
## 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:
|
||||
default:
|
||||
|
|
Loading…
Reference in a new issue