-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
38 lines (29 loc) · 855 Bytes
/
Makefile
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
PORTS = -p 8000:8000
ENV = \
-e AMADEUS_CLIENT_ID=${AMADEUS_CLIENT_ID} \
-e AMADEUS_CLIENT_SECRET=${AMADEUS_CLIENT_SECRET} \
-e AMADEUS_HOSTNAME=${AMADEUS_HOSTNAME} \
-e DEBUG_VALUE=${DEBUG_VALUE}
NS ?= amadeus4dev
VERSION ?= latest
IMAGE_NAME ?= flight-search-demo
CONTAINER_NAME ?= flight-search-demo
CONTAINER_INSTANCE ?= default
build: Dockerfile
docker build -t $(NS)/$(IMAGE_NAME):$(VERSION) -f Dockerfile .
run:
docker run --rm -i -t --name $(CONTAINER_NAME)-$(CONTAINER_INSTANCE) \
$(PORTS) \
$(ENV) \
$(NS)/$(IMAGE_NAME):$(VERSION)
start:
docker run -d --name $(CONTAINER_NAME)-$(CONTAINER_INSTANCE) \
$(PORTS) \
$(ENV) \
$(NS)/$(IMAGE_NAME):$(VERSION)
stop:
docker stop $(CONTAINER_NAME)-$(CONTAINER_INSTANCE)
rm:
docker rm $(CONTAINER_NAME)-$(CONTAINER_INSTANCE)
default: build
.PHONY: build run start stop rm