1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-22 12:15:36 +01:00

new dir for docker env overrides dir

This commit is contained in:
Kyle Spearrin 2017-08-19 22:09:00 -04:00
parent aa56b51cb5
commit abcb63bf25
4 changed files with 28 additions and 28 deletions

View File

@ -3,31 +3,31 @@ version: '3'
services:
mssql:
volumes:
- /etc/bitwarden/mssql_data:/var/opt/mssql/data
- ../../mssql_data:/var/opt/mssql/data
env_file:
- mssql.env
- /etc/bitwarden/docker/mssql.override.env
- ../../env/mssql.override.env
web:
volumes:
- /etc/bitwarden/web:/etc/bitwarden/web
- ../../web:/etc/bitwarden/web
attachments:
volumes:
- /etc/bitwarden/core/attachments:/etc/bitwarden/core/attachments
- ../../core/attachments:/etc/bitwarden/core/attachments
api:
volumes:
- /etc/bitwarden/core:/etc/bitwarden/core
- ../../core:/etc/bitwarden/core
env_file:
- global.env
- /etc/bitwarden/docker/global.override.env
- ../../env/global.override.env
identity:
volumes:
- /etc/bitwarden/identity:/etc/bitwarden/identity
- /etc/bitwarden/core:/etc/bitwarden/core
- ../../identity:/etc/bitwarden/identity
- ../../core:/etc/bitwarden/core
env_file:
- global.env
- /etc/bitwarden/docker/global.override.env
- ../../env/global.override.env
nginx:
volumes:
- /etc/bitwarden/nginx:/etc/bitwarden/nginx
- /etc/bitwarden/letsencrypt:/etc/letsencrypt
- /etc/bitwarden/ssl:/etc/ssl
- ../../nginx:/etc/bitwarden/nginx
- ../../letsencrypt:/etc/letsencrypt
- ../../ssl:/etc/ssl

View File

@ -6,30 +6,30 @@ services:
- mssql_data:/var/opt/mssql/data
env_file:
- mssql.env
- /etc/bitwarden/docker/mssql.override.env
- ../../env/mssql.override.env
web:
volumes:
- /etc/bitwarden/web:/etc/bitwarden/web
- ../../web:/etc/bitwarden/web
attachments:
volumes:
- /etc/bitwarden/core/attachments:/etc/bitwarden/core/attachments
- ../../core/attachments:/etc/bitwarden/core/attachments
api:
volumes:
- /etc/bitwarden/core:/etc/bitwarden/core
- ../../core:/etc/bitwarden/core
env_file:
- global.env
- /etc/bitwarden/docker/global.override.env
- ../../env/global.override.env
identity:
volumes:
- /etc/bitwarden/identity:/etc/bitwarden/identity
- /etc/bitwarden/core:/etc/bitwarden/core
- ../../identity:/etc/bitwarden/identity
- ../../core:/etc/bitwarden/core
env_file:
- global.env
- /etc/bitwarden/docker/global.override.env
- ../../env/global.override.env
nginx:
volumes:
- /etc/bitwarden/nginx:/etc/bitwarden/nginx
- /etc/bitwarden/letsencrypt:/etc/letsencrypt
- /etc/bitwarden/ssl:/etc/ssl
- ../../nginx:/etc/bitwarden/nginx
- ../../letsencrypt:/etc/letsencrypt
- ../../ssl:/etc/ssl
volumes:
mssql_data:

View File

@ -110,12 +110,12 @@ namespace Setup
public static string GetDatabasePasswordFronEnvFile()
{
if(!File.Exists("/bitwarden/docker/mssql.override.env"))
if(!File.Exists("/bitwarden/env/mssql.override.env"))
{
return null;
}
var lines = File.ReadAllLines("/bitwarden/docker/mssql.override.env");
var lines = File.ReadAllLines("/bitwarden/env/mssql.override.env");
foreach(var line in lines)
{
if(line.StartsWith("SA_PASSWORD="))

View File

@ -360,11 +360,11 @@ server {{
private static void BuildEnvironmentFiles()
{
Console.WriteLine("Building docker environment override files.");
Directory.CreateDirectory("/bitwarden/docker/");
Directory.CreateDirectory("/bitwarden/env/");
var dbPass = Helpers.SecureRandomString(32);
var dbConnectionString = Helpers.MakeSqlConnectionString("mssql", "vault", "sa", dbPass);
using(var sw = File.CreateText("/bitwarden/docker/global.override.env"))
using(var sw = File.CreateText("/bitwarden/env/global.override.env"))
{
sw.Write($@"globalSettings__baseServiceUri__vault={_url}
globalSettings__baseServiceUri__api={_url}/api
@ -389,7 +389,7 @@ globalSettings__pushRelayBaseUri=REPLACE");
}
}
using(var sw = File.CreateText("/bitwarden/docker/mssql.override.env"))
using(var sw = File.CreateText("/bitwarden/env/mssql.override.env"))
{
sw.Write($@"ACCEPT_EULA=Y
MSSQL_PID=Express