feat(bitwarden): move Bitwarden setup to task model
fix: newline escape
This commit is contained in:
parent
92d8d3672d
commit
ca496b0b49
6 changed files with 43 additions and 0 deletions
6
services/bitwarden/build.sh
Normal file
6
services/bitwarden/build.sh
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source constants.sh
|
||||
|
||||
docker build -t $DB_IMAGE_NAME:dev -f Dockerfile-bitwarden-db .
|
||||
docker build -t $APP_IMAGE_NAME:dev -f Dockerfile-bitwarden-app .
|
8
services/bitwarden/constants.sh
Normal file
8
services/bitwarden/constants.sh
Normal file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
export APP_NAME="bitwarden"
|
||||
export APP_CONTAINER_NAME=$APP_NAME-app
|
||||
export APP_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$APP_CONTAINER_NAME
|
||||
export DB_CONTAINER_NAME=$APP_NAME-db
|
||||
export DB_IMAGE_NAME=$CONTAINER_NAME_PREFIX-$DB_CONTAINER_NAME
|
||||
export NETWORK_NAME=$APP_NAME-local
|
23
services/bitwarden/start.sh
Normal file
23
services/bitwarden/start.sh
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
source constants.sh
|
||||
|
||||
docker network create $NETWORK_NAME || echo "Network $NETWORK_NAME already exists"
|
||||
|
||||
docker run \
|
||||
--detach \
|
||||
--network $NETWORK_NAME \
|
||||
--name $DB_CONTAINER_NAME \
|
||||
--env-file $ENV_FILE_DIR/bitwarden-db.env \
|
||||
--mount type=bind,source=$APP_DATA_DIR/bitwarden/db,target=/var/lib/mysql \
|
||||
$DB_IMAGE_NAME:dev
|
||||
|
||||
docker run \
|
||||
--detach \
|
||||
--network $NETWORK_NAME \
|
||||
--name $APP_CONTAINER_NAME \
|
||||
--env-file $ENV_FILE_DIR/bitwarden-web.env \
|
||||
--publish 8080:8080 \
|
||||
--mount type=bind,source=$APP_DATA_DIR/bitwarden/config,target=/etc/bitwarden \
|
||||
--mount type=bind,source=$APP_DATA_DIR/bitwarden/logs,target=/var/log/bitwarden \
|
||||
$APP_IMAGE_NAME:dev
|
6
services/bitwarden/stop.sh
Normal file
6
services/bitwarden/stop.sh
Normal file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
source constants.sh
|
||||
|
||||
docker rm -f $APP_CONTAINER_NAME
|
||||
docker rm -f $DB_CONTAINER_NAME
|
Reference in a new issue