diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2018-02-20 16:16:15 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2018-02-20 16:16:15 +0100 |
commit | 3d19ce5671e45b8e06a91cb09065d81e22f9d6fd (patch) | |
tree | e6221f12bdc4c48f5dc919874265633e3709559c /adei/Makefile | |
download | adei-3d19ce5671e45b8e06a91cb09065d81e22f9d6fd.tar.gz adei-3d19ce5671e45b8e06a91cb09065d81e22f9d6fd.tar.bz2 adei-3d19ce5671e45b8e06a91cb09065d81e22f9d6fd.tar.xz adei-3d19ce5671e45b8e06a91cb09065d81e22f9d6fd.zip |
Initial import
Diffstat (limited to 'adei/Makefile')
-rw-r--r-- | adei/Makefile | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/adei/Makefile b/adei/Makefile new file mode 100644 index 0000000..eb40411 --- /dev/null +++ b/adei/Makefile @@ -0,0 +1,47 @@ +all: build +install: push + +.PHONY: rebuild build push start stop restart bash + +build: Dockerfile + docker build --tag chsa/adei:latest . + +rebuild: Dockerfile + docker build --no-cache --tag chsa/adei:latest . + +push: build + docker push chsa/adei:latest + +start: build + @if [ `docker ps | grep adei-mysql | wc -l` -eq 0 ]; then \ + if [ `docker ps -a | grep adei-mysql | wc -l` -eq 0 ]; then \ + docker run --name adei-mysql -p 53306:3306/tcp -e MYSQL_ROOT_PASSWORD="adei" -e MYSQL_DATABASE="adei" -e MYSQL_USER="adei" -e MYSQL_PASSWORD="adei" -d mysql:5.7 ;\ + else \ + docker start adei-mysql ;\ + fi ;\ + fi ;\ + if [ `docker ps | grep chsa/adei | wc -l` -eq 0 ]; then \ + if [ `docker ps -a | grep adei-full | wc -l` -gt 0 ]; then \ + echo "Removing the stalled copy..." ;\ + docker rm adei-full ;\ + fi ;\ + docker run -p 8000:80 --name adei-full --link adei-mysql:adei-mysql -e ADEI_PORTS=8000 -t -d chsa/adei:latest ;\ + else \ + echo "Already running..." ;\ + fi + +stop: + @if [ `docker ps | grep adei-full | wc -l` -gt 0 ]; then \ + docker stop adei-full ;\ + docker rm adei-full ;\ + fi + +stop_mysql: stop + docker stop adei-mysql + +restart: + make stop + make start + +bash: build + docker exec -it adei-full /bin/bash |