mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 06:04:03 +00:00
Add Postgres to db connections and docker-compose
This commit is contained in:
parent
dd4013c998
commit
4eab27e1f0
2 changed files with 29 additions and 6 deletions
|
|
@ -52,16 +52,25 @@ services:
|
|||
timeout: 10s
|
||||
retries: 10
|
||||
postgres:
|
||||
image: postgres:11
|
||||
image: 'postgres:15'
|
||||
ports:
|
||||
- '${FORWARD_DB_PORT:-5433}:5433'
|
||||
environment:
|
||||
POSTGRES_PASSWORD: password
|
||||
POSTGRES_USER: root # superuser name
|
||||
PGPASSWORD: '${DB_PASSWORD:-password}:password'
|
||||
POSTGRES_DB: main
|
||||
POSTGRES_USER: '${DB_USERNAME:-root}:root'
|
||||
POSTGRES_PASSWORD: '${DB_PASSWORD:-password}:password'
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
||||
interval: 10s
|
||||
test:
|
||||
- CMD
|
||||
- pg_isready
|
||||
- '-q'
|
||||
- '-d'
|
||||
- '${DB_DATABASE}'
|
||||
- '-U'
|
||||
- '${DB_USERNAME}'
|
||||
retries: 3
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
redis:
|
||||
image: redis:alpine
|
||||
healthcheck:
|
||||
|
|
|
|||
|
|
@ -84,6 +84,20 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
|||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
'database.connections.pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => 'postgres',
|
||||
'port' => env('DB_PORT', '5433'),
|
||||
'database' => 'main',
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'prefix_indexes' => true,
|
||||
'search_path' => 'public',
|
||||
'sslmode' => 'prefer',
|
||||
],
|
||||
'database.connections.sqlite.database' => ':memory:',
|
||||
'database.connections.mysql.host' => env('TENANCY_TEST_MYSQL_HOST', '127.0.0.1'),
|
||||
'database.connections.sqlsrv.username' => env('TENANCY_TEST_SQLSRV_USERNAME', 'sa'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue