-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
33 lines (26 loc) · 852 Bytes
/
makefile
File metadata and controls
33 lines (26 loc) · 852 Bytes
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
.PHONY: test build deploy run-debug run-prod load-env
DOCKER_IMAGE_NAME ?= py-ai-api
load-env:
@if [ -f .env ]; then \
set -a; \
source .env; \
set +a; \
fi
test: load-env
pytest -v
run-debug: load-env
FLASK_DEBUG=1 python app.py
run-prod: load-env
FLASK_DEBUG=0 python app.py
build: load-env
docker build --build-arg OPENAI_API_TYPE=$$OPENAI_API_TYPE \
--build-arg OPENAI_API_VERSION=$$OPENAI_API_VERSION \
--build-arg OPENAI_API_BASE=$$OPENAI_API_BASE \
--build-arg OPENAI_API_KEY=$$OPENAI_API_KEY \
--build-arg DEPLOYMENT_ID=$$DEPLOYMENT_ID \
--build-arg SEARCH_ENDPOINT=$$SEARCH_ENDPOINT \
--build-arg SEARCH_KEY=$$SEARCH_KEY \
--build-arg SEARCH_INDEX_NAME=$$SEARCH_INDEX_NAME \
-t $(DOCKER_IMAGE_NAME) .
deploy: load-env
ecs-deploy -c my-cluster -n my-service -i minha-api-flask:latest