@@ -61,15 +61,19 @@ CWD:=$(dir $(abspath $(lastword $(MAKEFILE_LIST))))
6161NOW: =$(shell date "+% Y-% m-% d")
6262LOG_WEB: =delphi_web_epidata_$(NOW ) .log
6363LOG_DB: =delphi_database_epidata_$(NOW ) .log
64+ WEB_CONTAINER_ID: =$(shell docker ps -q --filter 'name=delphi_web_epidata')
65+ DATABASE_CONTAINER_ID: =$(shell docker ps -q --filter 'name=delphi_database_epidata')
6466
6567
6668.PHONY =web
6769web :
6870 @# Stop container if running
69- @-docker ps | grep delphi_web_epidata && docker stop delphi_web_epidata
71+ @if [ $( WEB_CONTAINER_ID) ]; then\
72+ docker stop $(WEB_CONTAINER_ID ) ; \
73+ fi
7074
7175 @# Setup virtual network if it doesn't exist
72- @- docker network ls | grep delphi-net || docker network create --driver bridge delphi-net
76+ @docker network ls | grep delphi-net || docker network create --driver bridge delphi-net
7377
7478 @# Build the web_epidata image
7579 @cd repos/delphi/delphi-epidata;\
8690.PHONY =db
8791db :
8892 @# Stop container if running
89- @-docker ps | grep delphi_database_epidata && docker stop delphi_database_epidata
93+ @if [ $( DATABASE_CONTAINER_ID) ]; then\
94+ docker stop $(DATABASE_CONTAINER_ID ) ; \
95+ fi
9096
9197 @# Only build prereqs if we need them
92- @- docker images delphi_database | grep delphi || \
98+ @docker images delphi_database | grep delphi || \
9399 docker build -t delphi_database -f repos/delphi/operations/dev/docker/database/Dockerfile .
94100
95101 @# Build the database_epidata image
0 commit comments