mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 13:08:17 -05:00
Allow usage of default override file (#210)
* Updated run.sh to support default override This is equivalent to run docker-compose in the directory of the project (here "docker"). See: https://docs.docker.com/compose/extends/ Override allows to change some paramaters and extend the original compose file to your own environment (network config, CPU/RAM caps,...) * Updated run.ps1 to support docker override file Same as run.sh * Added conditionals for override file absence I misunderstood the documentation, that file must exist if file is specified on command line, added conditionals to support that case * Update run.ps1 to test for override file presence Same as .sh
This commit is contained in:
parent
5a9923092a
commit
fefda383d1
@ -17,15 +17,31 @@ $dockerDir="${outputDir}\docker"
|
||||
# Functions
|
||||
|
||||
function Docker-Compose-Up {
|
||||
docker-compose -f ${dockerDir}\docker-compose.yml up -d
|
||||
if(Test-Path -Path "${dockerDir}\docker-compose.override.yml" -PathType leaf) {
|
||||
docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.override.yml up -d
|
||||
}
|
||||
else {
|
||||
docker-compose -f ${dockerDir}\docker-compose.yml up -d
|
||||
}
|
||||
}
|
||||
|
||||
function Docker-Compose-Down {
|
||||
docker-compose -f ${dockerDir}\docker-compose.yml down
|
||||
if(Test-Path -Path "${dockerDir}\docker-compose.override.yml" -PathType leaf) {
|
||||
docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.override.yml down
|
||||
}
|
||||
else {
|
||||
docker-compose -f ${dockerDir}\docker-compose.yml down
|
||||
}
|
||||
}
|
||||
|
||||
function Docker-Compose-Pull {
|
||||
docker-compose -f ${dockerDir}\docker-compose.yml pull
|
||||
if(Test-Path -Path "${dockerDir}\docker-compose.override.yml" -PathType leaf) {
|
||||
docker-compose -f ${dockerDir}\docker-compose.yml -f ${dockerDir}\docker-compose.override.yml pull
|
||||
}
|
||||
else {
|
||||
docker-compose -f ${dockerDir}\docker-compose.yml pull
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Docker-Prune {
|
||||
|
@ -34,15 +34,30 @@ DOCKER_DIR="$OUTPUT_DIR/docker"
|
||||
# Functions
|
||||
|
||||
function dockerComposeUp() {
|
||||
docker-compose -f $DOCKER_DIR/docker-compose.yml up -d
|
||||
if [ -f "$DOCKER_DIR/docker-compose.override.yml" ]
|
||||
then
|
||||
docker-compose -f $DOCKER_DIR/docker-compose.yml -f $DOCKER_DIR/docker-compose.override.yml up -d
|
||||
else
|
||||
docker-compose -f $DOCKER_DIR/docker-compose.yml up -d
|
||||
fi
|
||||
}
|
||||
|
||||
function dockerComposeDown() {
|
||||
docker-compose -f $DOCKER_DIR/docker-compose.yml down
|
||||
if [ -f "$DOCKER_DIR/docker-compose.override.yml" ]
|
||||
then
|
||||
docker-compose -f $DOCKER_DIR/docker-compose.yml -f $DOCKER_DIR/docker-compose.override.yml down
|
||||
else
|
||||
docker-compose -f $DOCKER_DIR/docker-compose.yml down
|
||||
fi
|
||||
}
|
||||
|
||||
function dockerComposePull() {
|
||||
docker-compose -f $DOCKER_DIR/docker-compose.yml pull
|
||||
if [ -f "$DOCKER_DIR/docker-compose.override.yml" ]
|
||||
then
|
||||
docker-compose -f $DOCKER_DIR/docker-compose.yml -f $DOCKER_DIR/docker-compose.override.yml pull
|
||||
else
|
||||
docker-compose -f $DOCKER_DIR/docker-compose.yml pull
|
||||
fi
|
||||
}
|
||||
|
||||
function dockerPrune() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user