Skip to content

Commit 4e5261f

Browse files
authored
[Feature] PHP 8.2 and performance improvements (alexjustesen#676)
1 parent dc6538d commit 4e5261f

19 files changed

+55
-164
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ Homestead.json
2323
Homestead.yaml
2424
npm-debug.log
2525
yarn-error.log
26+
*.postman_collection.json

.env.example

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ APP_KEY=
44
APP_DEBUG=false
55
APP_URL=http://localhost
66

7+
FORCE_HTTPS=false
8+
DASHBOARD_POLLING=60
9+
NOTIFICATION_POLLING=60
10+
RESULTS_POLLING=false
11+
712
LOG_CHANNEL=stack
813
LOG_DEPRECATIONS_CHANNEL=null
914
LOG_LEVEL=debug
@@ -37,4 +42,4 @@ AWS_DEFAULT_REGION=us-east-1
3742
AWS_BUCKET=
3843
AWS_USE_PATH_STYLE_ENDPOINT=false
3944

40-
TELEGRAM_BOT_TOKEN=
45+
TELEGRAM_BOT_TOKEN=null

.env.production

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
1-
APP_NAME="Speedtest Tracker"
2-
APP_ENV=production
3-
APP_KEY=
4-
APP_DEBUG=false
5-
APP_URL=http://localhost
6-
7-
FORCE_HTTPS=false
8-
9-
LOG_CHANNEL=stderr
10-
LOG_DEPRECATIONS_CHANNEL=null
11-
LOG_LEVEL=error
1+
# A full list of options can be found in the '.env.example' file.
122

13-
DB_CONNECTION=mysql
14-
DB_HOST=127.0.0.1
15-
DB_PORT=3306
16-
DB_DATABASE=speedtest_tracker
17-
DB_USERNAME=
18-
DB_PASSWORD=
3+
# Application key
4+
# Used for encryption where needed, if a key is not generated run: php artisan key:generate
5+
APP_KEY=
196

20-
BROADCAST_DRIVER=log
21-
CACHE_DRIVER=database
22-
FILESYSTEM_DISK=local
23-
QUEUE_CONNECTION=database
24-
SESSION_DRIVER=database
25-
SESSION_LIFETIME=120
7+
# Application URL
8+
# Not used in the URL but effects links in emails and notifications: https://docs.speedtest-tracker.dev/faqs#links-in-emails-dont-point-to-the-correct-url
9+
APP_URL=http://localhost
2610

11+
# SMTP mail config
12+
# Only SMTP protocol is supported at this time: https://docs.speedtest-tracker.dev/settings/notifications/mail
2713
MAIL_MAILER=smtp
2814
MAIL_HOST=mailhog
2915
MAIL_PORT=1025
@@ -33,10 +19,5 @@ MAIL_ENCRYPTION=null
3319
MAIL_FROM_ADDRESS="[email protected]"
3420
MAIL_FROM_NAME="${APP_NAME}"
3521

36-
AWS_ACCESS_KEY_ID=
37-
AWS_SECRET_ACCESS_KEY=
38-
AWS_DEFAULT_REGION=us-east-1
39-
AWS_BUCKET=
40-
AWS_USE_PATH_STYLE_ENDPOINT=false
41-
42-
TELEGRAM_BOT_TOKEN=
22+
# Telegram bot config
23+
TELEGRAM_BOT_TOKEN=null

.github/pull_request_template.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@ A short description of the pull request changes should go here and the sections
55
## Changelog
66

77
### Added
8+
89
- one
910
- two
1011

1112
### Changed
13+
1214
- one
1315
- two
1416

1517
### Fixed
18+
1619
- one
1720
- two
1821

1922
### Removed
23+
2024
- one
2125
- two
2226

Dockerfile

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM serversideup/php:8.1-fpm-nginx
1+
FROM serversideup/php:8.2-fpm-nginx
22

33
# Add /config to allowed directory tree
44
ENV PHP_OPEN_BASEDIR=$WEBUSER_HOME:/config/:/dev/stdout:/tmp
@@ -11,7 +11,7 @@ RUN apt-get update \
1111
&& apt-get install -y --no-install-recommends \
1212
cron \
1313
htop \
14-
php8.1-pgsql \
14+
php8.2-pgsql \
1515
&& echo "MAILTO=\"\"\n* * * * * webuser /usr/bin/php /var/www/html/artisan schedule:run" > /etc/cron.d/laravel \
1616
\
1717
# Install Speedtest cli
@@ -25,15 +25,17 @@ RUN apt-get update \
2525
# Copy package configs
2626
COPY --chmod=755 docker/deploy/etc/s6-overlay/ /etc/s6-overlay/
2727

28-
WORKDIR /var/www/html
29-
3028
# Copy app
31-
COPY --chown=webuser:webgroup . /var/www/html
29+
COPY --chown=webuser:webgroup . $WEBUSER_HOME
30+
31+
WORKDIR $WEBUSER_HOME
3232

3333
# Install app dependencies
34-
RUN composer install --no-interaction --prefer-dist --optimize-autoloader --no-dev --no-cache \
35-
&& mkdir -p storage/logs \
36-
&& php artisan optimize:clear \
37-
&& chown -R webuser:webgroup /var/www/html
34+
RUN composer install \
35+
--no-interaction \
36+
--prefer-dist \
37+
--optimize-autoloader \
38+
--no-dev \
39+
--no-cache
3840

3941
VOLUME /config

config/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
|
1717
*/
1818

19-
'name' => env('APP_NAME', 'Laravel'),
19+
'name' => env('APP_NAME', 'Speedtest Tracker'),
2020

2121
/*
2222
|--------------------------------------------------------------------------

config/broadcasting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
|
1616
*/
1717

18-
'default' => env('BROADCAST_DRIVER', 'null'),
18+
'default' => env('BROADCAST_DRIVER', 'log'),
1919

2020
/*
2121
|--------------------------------------------------------------------------

config/cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
|
1616
*/
1717

18-
'default' => env('CACHE_DRIVER', 'file'),
18+
'default' => env('CACHE_DRIVER', 'database'),
1919

2020
/*
2121
|--------------------------------------------------------------------------

config/logging.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
|
1919
*/
2020

21-
'default' => env('LOG_CHANNEL', 'stack'),
21+
'default' => env('LOG_CHANNEL', 'stderr'),
2222

2323
/*
2424
|--------------------------------------------------------------------------

config/session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
|
1919
*/
2020

21-
'driver' => env('SESSION_DRIVER', 'file'),
21+
'driver' => env('SESSION_DRIVER', 'database'),
2222

2323
/*
2424
|--------------------------------------------------------------------------

0 commit comments

Comments
 (0)