Skip to content

Commit

Permalink
Fix DB connection with sockets (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric authored May 11, 2023
1 parent 8a9df1f commit 701c40e
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ export APP_DEFAULT_TIMEZONE="UTC"
export SECURITY_SALT="__SALT__"
export MAIN_DOMAIN="__MAIN_DOMAIN__"

export DATABASE_URL="mysql://my_app:secret@localhost/${APP_NAME}?encoding=utf8mb4&timezone=UTC&cacheMetadata=true&quoteIdentifiers=false&persistent=false"
export DATABASE_USER="__DATABASE_USER__"
export DATABASE_PASSWORD="__DATABASE_PASSWORD__"
export DATABASE_NAME="__DATABASE_NAME__"
export DATABASE_SOCKET="__DATABASE_SOCKET__"

export SLACK_CLIENT_ID="__SLACK_CLIENT_ID__"
export SLACK_CLIENT_SECRET="__SLACK_CLIENT_SECRET__"
Expand Down
5 changes: 4 additions & 1 deletion config/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,10 @@
*/
// 'init' => ['SET GLOBAL innodb_stats_on_metadata = 0'],

'url' => env('DATABASE_URL', null),
'username' => env('DATABASE_USER'),
'password' => env('DATABASE_PASSWORD'),
'database' => env('DATABASE_NAME'),
'unix_socket' => env('DATABASE_SOCKET'),
],
],

Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ services:
- APP_DEFAULT_TIMEZONE
- SECURITY_SALT
- MAIN_DOMAIN
- DATABASE_URL
- DATABASE_USER
- DATABASE_PASSWORD
- DATABASE_NAME
- DATABASE_SOCKET
- SLACK_CLIENT_ID
- SLACK_CLIENT_SECRET
- SLACK_SIGNING_SECRET
Expand Down
5 changes: 4 additions & 1 deletion docker/backend/apache/environment.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ PassENV APP_DEFAULT_LOCALE
PassEnv APP_DEFAULT_TIMEZONE
PassEnv SECURITY_SALT
PassEnv MAIN_DOMAIN
PassEnv DATABASE_URL
PassEnv DATABASE_USER
PassEnv DATABASE_PASSWORD
PassEnv DATABASE_NAME
PassEnv DATABASE_SOCKET
PassEnv SLACK_CLIENT_ID
PassEnv SLACK_CLIENT_SECRET
PassEnv SLACK_SIGNING_SECRET
Expand Down

0 comments on commit 701c40e

Please # to comment.