-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
35 lines (28 loc) · 814 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
BASE_PATH = app
PROJECT_NAME = uploads3
IMAGE = $(PROJECT_NAME):latest
ENV = dev
# Container
copy_requirements:
@cp $(BASE_PATH)/$(PROJECT_NAME)/requirements.txt docker/resources/requirements.txt
image: copy_requirements
@docker build -f docker/Dockerfile -t $(IMAGE) ./docker
@rm docker/resources/requirements.txt
container:
@docker run --rm -it\
-v $(PWD)/$(BASE_PATH):/$(BASE_PATH) \
-v ~/.aws/config:/root/.aws/config \
-v ~/.aws/credentials:/root/.aws/credentials \
-w /$(BASE_PATH)/$(PROJECT_NAME) \
-p 8080:8080/ \
$(IMAGE) \
$(COMMAND)
ssh:
@make container COMMAND=sh
# Chalice
deploy:
@make container COMMAND="chalice deploy --stage=$(ENV)"
delete:
@make container COMMAND="chalice delete --stage=$(ENV)"
up:
@make container COMMAND="chalice local --host=0.0.0.0 --port=8080"