-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (34 loc) · 860 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
39
40
41
42
# Container's default name
NAME=restapi_testfwk
# Docker image default name
IMAGE=test/$(NAME)
# Mount localfile system for local development
LOCAL_OPTS=-v "$(shell pwd)":/opt/restapi_testfwk -e PYTHONPATH="/opt/restapi_testfwk"
# Build image
.PHONY: build
build:
@echo "--> Building $(NAME)"
docker build -t $(IMAGE) .
# Stop container
.PHONY: stop
stop:
@echo "--> Stopping $(NAME)"
docker kill $(NAME) || true
# Start container
.PHONY: start
start:
@echo "--> Starting $(NAME)"
docker start $(NAME)
# Remove container
.PHONY: rm
rm:
@echo "--> Removing container $(NAME)"
docker rm -f $(NAME) || true
# Run container and provide a Shell terminal
.PHONY: local
local:
@echo "--> Starting $(NAME)"
docker run $(LOCAL_OPTS) --name $(NAME) --env-file secrets.ini -it $(IMAGE) /bin/bash
# Local development
.PHONY: dev
dev: stop rm build local