-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (47 loc) · 1.21 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
53
54
55
56
COMPOSE_FILE := compose.yaml
.PHONY: all
all: up
DB_SERVICE := db
DB_NAME := main_db
DB_USER := user
DB_PASSWORD := password # Set your development password here
# Start the application
.PHONY: up
up:
docker-compose -f $(COMPOSE_FILE) up -d
# Stop the application
.PHONY: down
down:
docker-compose -f $(COMPOSE_FILE) down
# Rebuild and start the application
.PHONY: build
build:
docker-compose -f $(COMPOSE_FILE) up -d --build
# Show logs
.PHONY: logs
logs:
docker-compose -f $(COMPOSE_FILE) logs -f
# Clean up
.PHONY: clean
clean:
docker-compose -f $(COMPOSE_FILE) down -v --remove-orphans
# Run tests
.PHONY: test
test:
@echo "Running tests..."
# TODO: Add tests
# Access MySQL shell
.PHONY: db-shell
db-shell:
docker-compose -f $(COMPOSE_FILE) exec $(DB_SERVICE) mysql -u$(DB_USER) -p$(DB_PASSWORD) $(DB_NAME)
# Help
.PHONY: help
help:
@echo "Available commands:"
@echo " make up - Start the application"
@echo " make down - Stop the application"
@echo " make build - Rebuild and start the application"
@echo " make logs - Show logs"
@echo " make clean - Clean up containers and volumes"
@echo " make test - Run tests"
@echo " make db-shell - Access MySQL shell"