Skip to content

Commit

Permalink
#170 Upgrade to Laravel 8 and PHP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Petcu committed Jul 30, 2021
1 parent 6a298ca commit 868a4e2
Show file tree
Hide file tree
Showing 10 changed files with 1,682 additions and 967 deletions.
15 changes: 12 additions & 3 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM citizennext/webserver:latest
FROM citizennext/webserver:php8

ENV DEBIAN_FRONTEND noninteractive

ARG APP_ENV
ARG APP_KEY
Expand Down Expand Up @@ -85,12 +87,20 @@ ENV NOCAPTCHA_SECRET=${NOCAPTCHA_SECRET}
ENV NOCAPTCHA_SITEKEY=${NOCAPTCHA_SITEKEY}
ENV GOOGLE_MAPS_API_KEY=${GOOGLE_MAPS_API_KEY}

# install packages
RUN apt-get install --no-install-recommends -y curl

RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

# copy application file
COPY . /var/www/html

# create application environment file
RUN cp .env.example .env

# run composer again to optimize autoload.
RUN composer install --optimize-autoloader --no-dev --no-cache

# prepare Laravel log
RUN touch /var/www/html/storage/logs/laravel.log
RUN chmod 777 /var/www/html/storage/logs/laravel.log
Expand All @@ -103,8 +113,7 @@ COPY .docker/config/nginx/default /etc/nginx/sites-available/default
COPY .docker/config/nginx/nginx.conf /etc/nginx/nginx.conf

# configure php-fpm
COPY .docker/config/php-fpm/www.conf /etc/php/7.4/fpm/pool.d/www.conf

COPY .docker/config/php-fpm/www.conf /etc/php/8.0/fpm/pool.d/www.conf

EXPOSE 80

Expand Down
2 changes: 1 addition & 1 deletion .docker/config/nginx/default
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ server {
client_max_body_size 128m;

location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_pass unix:/run/php/php8.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
Expand Down
4 changes: 2 additions & 2 deletions .docker/config/supervisor/supervisor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
nodaemon=true

[program:php-fpm]
command=/usr/sbin/php-fpm7.4 -F
command=/etc/init.d/php8.0-fpm start
autostart=true
autorestart=true
log_stdout=true
Expand All @@ -15,4 +15,4 @@ autostart=true
autorestart=true
log_stdout=true
log_stderr=true
priority=100
priority=100
2 changes: 1 addition & 1 deletion .docker/webserver/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM citizennext/webserver:latest
FROM citizennext/webserver:php8

# install Nginx
COPY config/nginx/default /etc/nginx/sites-available/default
Expand Down
2 changes: 1 addition & 1 deletion .docker/webserver/config/nginx/default
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ server {
client_max_body_size 128m;

location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
fastcgi_index index.php;
fastcgi_read_timeout 300;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
Expand Down
2 changes: 1 addition & 1 deletion .docker/webserver/config/supervisor/supervisor.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
nodaemon=true

[program:php-fpm]
command=/usr/sbin/php-fpm7.4 -F
command=/etc/init.d/php8.0-fpm start
autostart=true
autorestart=true
log_stdout=true
Expand Down
32 changes: 16 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,42 @@
"keywords": [],
"license": "MIT",
"require": {
"php": "^7.4",
"php": "^7.3|^8.0",
"ext-curl": "*",
"ext-intl": "*",
"ext-json": "*",
"ext-mysqli": "*",
"ext-openssl": "*",
"anhskohbo/no-captcha": "^3.3",
"area17/twill": "2.1.1",
"area17/twill": "^2.4",
"aws/aws-sdk-php": "^3.149",
"doctrine/dbal": "^2.10",
"fideloper/proxy": "^4.2",
"fideloper/proxy": "^4.4",
"flynsarmy/csv-seeder": "^2.0",
"fruitcake/laravel-cors": "^1.0",
"fruitcake/laravel-cors": "^2.0",
"giggsey/libphonenumber-for-php": "^8.12",
"guzzlehttp/guzzle": "^6.3",
"guzzlehttp/guzzle": "^7.0.1",
"langleyfoxall/laravel-nist-password-rules": "^4.3",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"laravel/ui": "^2.1",
"laravel/framework": "^8.40",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.3",
"league/flysystem-aws-s3-v3": "^1.0",
"owen-it/laravel-auditing": "^11.0",
"owen-it/laravel-auditing": "^12.0",
"pragmarx/google2fa-laravel": "^1.3",
"propaganistas/laravel-phone": "^4.2",
"sentry/sentry-laravel": "^2.3",
"spatie/laravel-cookie-consent": "^2.12",
"spatie/laravel-permission": "^3.13",
"spatie/laravel-sluggable": "^2.5",
"teamtnt/laravel-scout-tntsearch-driver": "^9.0",
"spatie/laravel-sluggable": "^3.1",
"teamtnt/laravel-scout-tntsearch-driver": "^11.5",
"yajra/laravel-datatables": "^1.5"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"phpunit/phpunit": "^9.3.3"
},
"config": {
"optimize-autoloader": true,
Expand Down
Loading

0 comments on commit 868a4e2

Please sign in to comment.