-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (42 loc) · 1.15 KB
/
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
43
44
45
46
47
48
49
50
51
52
# project related
PROJECT_NAME:=voyager
CONTAINER_NAME:=voyager:v0.2.0
ENV_FILE:=.env
APP_PORT:=8000
EXPOST_PORT:=80
DATABASE_BIND_PATH:=./lancedb
REGION:=ap-southeast-2
MODEL_ID:=anthropic.claude-3-sonnet-20240229-v1:0
# build and run this service only
.PHONY: build
build:
@docker build -t $(CONTAINER_NAME) .
.PHONY: run
run: build
@docker run --rm -p $(APP_PORT):$(APP_PORT) --name $(PROJECT_NAME) $(CONTAINER_NAME)
.PHONY: env
env:
@echo "APP_PORT=$(APP_PORT)"> $(ENV_FILE)
@echo "EXPOST_PORT=$(EXPOST_PORT)">> $(ENV_FILE)
@echo "PROJECT_NAME=$(PROJECT_NAME)">> $(ENV_FILE)
@echo "DATABASE_BIND_PATH=$(DATABASE_BIND_PATH)">> $(ENV_FILE)
@echo "REGION=$(REGION)">> $(ENV_FILE)
@echo "MODEL_ID=$(MODEL_ID)">> $(ENV_FILE)
# normal build & up
.PHONY: compose-build
compose-build: env
@docker compose -f docker-compose.yaml build
.PHONY: up
up: compose-build
@docker compose -f docker-compose.yaml up -d
# dev build & up
.PHONY: compose-build-dev
compose-build-dev: env
@docker compose -f docker-compose-dev.yaml build
.PHONY: dev
dev: compose-build-dev
@docker compose -f docker-compose-dev.yaml up -d
# stop
.PHONY: stop
stop:
docker compose stop