-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (39 loc) · 1.12 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
# Makefile for managing the FastAPI application
# Define variables
IMAGE_NAME=yoga-hub
CONTAINER_NAME=yoga-hub
PORT=8000
TAG=cpu-v1.1.0
# Build the Docker image
build:
docker build -f docker/DockerfileCPU -t $(IMAGE_NAME):$(TAG) .
# Run the Docker container
run:
docker run -d --name $(CONTAINER_NAME) -p $(PORT):$(PORT) $(IMAGE_NAME):$(TAG)
# Stop the Docker container
stop:
docker stop $(CONTAINER_NAME)
# Remove the Docker container
remove: stop
docker rm $(CONTAINER_NAME)
# Access the container's shell
shell:
docker exec -it $(CONTAINER_NAME) /bin/sh
# View container logs
logs:
docker logs $(CONTAINER_NAME)
# Run tests (you can customize this according to your test setup)
test:
python -m unittest discover -s tests
# Clean up (add any additional clean-up commands as needed)
clean:
find . -type f -name '*.pyc' -delete
find . -type d -name '__pycache__' -delete
lint:
pre-commit run --all-files
test-api:
curl -X POST "http://localhost:8000/predict" \
-H "accept: application/json" \
-H "Content-Type: multipart/form-data" \
-F "image=@example/test.png"
.PHONY: build run stop remove shell logs test clean