From f70fb5a74a52974aa8f5be15077d48f4f93a0bbf Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Wed, 12 Jan 2022 14:17:30 +0100 Subject: [PATCH] Add alternative databases to development docker-compose (#1797) --- dev/.env.example | 4 ++++ dev/docker-compose.yml | 33 +++++++++++++++++++++++++++++++++ dev/secrets.json.example | 6 ++++++ 3 files changed, 43 insertions(+) diff --git a/dev/.env.example b/dev/.env.example index 7cfd5bb79..5d5d11be8 100644 --- a/dev/.env.example +++ b/dev/.env.example @@ -3,3 +3,7 @@ COMPOSE_PROJECT_NAME=BitwardenServer # https://docs.microsoft.com/en-us/sql/relational-databases/security/password-policy?view=sql-server-ver15 MSSQL_PASSWORD=SET_A_PASSWORD_HERE_123 MAILCATCHER_PORT=1080 + +# Alternative databases +POSTGRES_PASSWORD=SET_A_PASSWORD_HERE_123 +MYSQL_ROOT_PASSWORD=SET_A_PASSWORD_HERE_123 diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index 5e7381cf3..9d29e2954 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -39,5 +39,38 @@ services: profiles: - mail + postgres: + image: postgres:14 + restart: always + ports: + - "5432:5432" + environment: + POSTGRES_DB: vault_dev + POSTGRES_USER: postgres + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} + volumes: + - postgres_dev_data:/var/lib/postgresql/data + - ./.data/postgres/config:/etc/postgresql + - ./.data/postgres/log:/var/log/postgresql + profiles: + - postgres + + mysql: + image: mysql:8 + container_name: bw-mysql + restart: always + ports: + - "3306:3306" + command: --default-authentication-plugin=mysql_native_password + environment: + MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD} + MYSQL_DATABASE: vault_dev + volumes: + - mysql_dev_data:/var/lib/mysql + profiles: + - mysql + volumes: edgesql_dev_data: + postgres_dev_data: + mysql_dev_data: diff --git a/dev/secrets.json.example b/dev/secrets.json.example index 543ceb7d7..df22bcdb2 100644 --- a/dev/secrets.json.example +++ b/dev/secrets.json.example @@ -7,6 +7,12 @@ "sqlServer": { "connectionString": "Server=localhost;Database=vault_dev;User Id=SA;Password=SET_A_PASSWORD_HERE_123;" }, + "postgreSql": { + "connectionString": "Host=localhost;Username=postgres;Password=SET_A_PASSWORD_HERE_123;Database=vault_dev;Include Error Detail=true", + }, + "mySql": { + "connectionString": "server=localhost;uid=root;pwd=SET_A_PASSWORD_HERE_123;database=vault_dev" + }, "identityServer": { "certificateThumbprint": "" },