-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (35 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
# Define the default target
.DEFAULT_GOAL := up
# Load environment variables from .env file
ifneq (,$(wildcard .env))
include .env
export
endif
# Set COMPOSE_FILES to always use docker-compose.yml
COMPOSE_FILES = -f docker-compose.yml
# Target to start the services
up:
@echo "Starting services with Docker Compose..."
docker-compose $(COMPOSE_FILES) up -d
# Target to stop the services and remove related containers and images
down:
@echo "Stopping services with Docker Compose..."
docker-compose $(COMPOSE_FILES) down
@echo "Removing stopped containers..."
docker-compose $(COMPOSE_FILES) rm -f
@echo "Removing related images..."
docker rmi -f custom-pgvector
# Target to build the services
build:
@echo "Building services with Docker Compose..."
docker-compose $(COMPOSE_FILES) build
# Target to view logs
logs:
@echo "Viewing logs for services..."
docker-compose $(COMPOSE_FILES) logs -f
# Target to print the value of ENABLE_FASTAPI
print-env:
@echo "DATABASE_URL: $(DATABASE_URL)"
migrate:
@echo "Running alembic migrations with Docker Compose..."
docker-compose -f docker-compose.fastapi.yml run fastapi alembic upgrade head