-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
49 lines (40 loc) · 1.14 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
############################## DOCKER ######################################
# Default Variables
IMAGE_NAME ?= crew-ai-xls
CONTAINER_NAME ?= crew-ai-xls-cntnr
PORT ?= 8000
# Build the Docker image
build:
docker build -t $(IMAGE_NAME) .
# Run the Docker container
run:
@if [ "$$(docker ps -q -f name=$(CONTAINER_NAME))" ]; then \
echo "Stop and remove running container $(CONTAINER_NAME)..."; \
docker stop $(CONTAINER_NAME); \
docker rm $(CONTAINER_NAME); \
fi
docker run -d --name $(CONTAINER_NAME) -p $(PORT):$(PORT) $(IMAGE_NAME)
# Stop the Docker container
stop:
docker stop $(CONTAINER_NAME)
# Remove the Docker container
rm:
docker rm $(CONTAINER_NAME)
# View logs from the running container
logs:
docker logs -f $(CONTAINER_NAME)
# Rebuild and run the Docker container
rerun: stop rm build run
# Clean up all unused images and containers
clean:
docker system prune -f
################################### DEVELOPER DEBUG ##################################
CONDA_NAME ?= mypi310
conda:
conda activate $(CONDA_NAME)
pyrundev:
python -m uvicorn main:app --reload
pyrunprod:
python -m uvicorn main:app
reqs:
pipreqs --ignore templates .