-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy_docker.sh
executable file
·45 lines (33 loc) · 1.29 KB
/
deploy_docker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash
SCRIPTDIR="$(cd "$(dirname "$0")" && pwd)"
DOCKER_NAME="webhooks"
DOCKER_TAG="latest"
DPORT=5000
LPORT=55001
DDIR_BASE="/opt/repo/app"
LDIR_BASE="$SCRIPTDIR/test/webhooks"
DDIR_BACKUP="$DDIR_BASE/backup.jsons"
LDIR_BACKUP="$LDIR_BASE/backup.jsons"
DDIR_CLONE="$DDIR_BASE/backup.git"
LDIR_CLONE="$LDIR_BASE/backup.git"
DDIR_HOOKS="$DDIR_BASE/hooks"
LDIR_HOOKS="$LDIR_BASE/hooks"
mkdir -p "$LDIR_BACKUP"
mkdir -p "$LDIR_CLONE"
mkdir -p "$LDIR_HOOKS"
docker build --pull -f ./Dockerfile -t $DOCKER_NAME:$DOCKER_TAG .
echo "###################################################"
echo "##### "
echo "##### Directories"
echo "##### Base : $LDIR_BASE"
echo "##### Backup : $LDIR_BACKUP"
echo "##### Clone : $LDIR_CLONE"
echo "##### Hooks : $LDIR_HOOKS"
echo "#####"
echo "##### Starting Docker Container $DOCKER_NAME:$DOCKER_TAG as service..."
echo "#####"
echo "##### Container is reachable via port $LPORT"
echo "#####"
echo "###################################################"
#docker run -d -p 5000:5000 -u 112233 -v "$LDIR_BACKUP":"$DDIR_BACKUP" -v "$LDIR_CLONE":"$DDIR_CLONE" -v "$LDIR_HOOKS":"$DDIR_HOOKS" $DOCKER_NAME:$DOCKER_TAG
docker run -d -p $LPORT:$DPORT -v "$LDIR_BACKUP":"$DDIR_BACKUP" -v "$LDIR_CLONE":"$DDIR_CLONE" -v "$LDIR_HOOKS":"$DDIR_HOOKS" $DOCKER_NAME:$DOCKER_TAG