ME=$(USER)
REPO=biocase/bps:latest
CONTAINER=biocase
PORT=80

	
install:
	@echo "Downloading latest BioCASe image..."
	@docker pull "$(REPO)"
	@echo "Creating container and starting BioCASe..."
	@docker run -d -p$(PORT):80 --name=$(CONTAINER) --hostname=$(CONTAINER) \
	  --mount source=bps_config,target=/opt/biocase/config --mount source=bps_log,target=/opt/biocase/log \
	  --mount source=bps_archive,target=/opt/biocase/archive --mount source=bps_downloads,target=/opt/biocase/www/downloads \
	  "$(REPO)"

remove:
	@echo "Stopping BioCASe..."
	@docker stop $(CONTAINER)
	@echo "Removing BioCASe container..."
	@docker rm $(CONTAINER) 

update: remove install

stop:
	@echo "Stopping BioCASe..."
	@docker stop $(CONTAINER)

start:
	@echo "Starting BioCASe..."
	@docker start $(CONTAINER)