-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
36 lines (27 loc) · 1.04 KB
/
build.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
#!/bin/bash
DOCKERIMAGE="homeconnect"
CONTAINERLABEL="homeconnect"
DOCKER_TIMEZONE=Europe/Berlin
# persistant applications dir
APPSDATA=/dockerapps/_lab/homeconnect-hcpy
echo "Clean Python app ${DOCKERIMAGE}..."
pyclean . --debris --verbose
echo "Try to remove previuos installation..."
docker stop ${CONTAINERLABEL} >/dev/null 2>&1
docker rm ${CONTAINERLABEL} >/dev/null 2>&1
echo "Try to remove docker logs for ${CONTAINERLABEL} ..."
sh -c 'echo "" > /var/log/docker/zeusus_${CONTAINERLABEL}.log'
echo "Try to remove apps error logs for ${CONTAINERLABEL} ..."
rm ${PWD}/logs/*.*
echo "Build Docker Image ${DOCKERIMAGE}..."
docker build -t ${DOCKERIMAGE} .
echo "Install Docker Image ${DOCKERIMAGE}..."
docker run -it --detach \
--name ${CONTAINERLABEL} \
--volume ${PWD}/config:/app/config \
--volume ${PWD}/data:/app/data \
--volume ${PWD}/logs:/app/logs \
--env TZ=${DOCKER_TIMEZONE} \
--restart unless-stopped \
${DOCKERIMAGE}
echo "Docker App ${DOCKERIMAGE} ready..."