-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·41 lines (36 loc) · 1.03 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
# Define your services
SERVICES=db backend
IMAGE=khoury-classroom-plugin-backend:latest
# Build and run the backend
.PHONY: backend
backend:
@echo "Starting backend containers..."
docker compose up $(DETACHED)
# Build a fresh instance of the backend
.PHONY: restart-backend
restart-backend:
@echo "Stopping and removing containers..."
docker rm -f $(SERVICES)
@echo "Removing backend image..."
docker rmi $(IMAGE)
@echo "Starting fresh instance of backend containers..."
docker compose up --build $(DETACHED)
# Build and run frontend
.PHONY: frontend
frontend:
@echo "Installing frontend dependencies..."
cd frontend && npm install
@echo "Linting frontend source code..."
cd frontend && npx eslint . || { echo "Linting failed. Exiting."; exit 1; }
@echo "Linting passed. Starting frontend..."
cd frontend && npm run dev
# Build and run whole app
.PHONY: app
app:
$(MAKE) DETACHED=-d backend
$(MAKE) frontend
# Build and run whole app with no caching
.PHONY: clean-app
clean-app:
$(MAKE) DETACHED=-d restart-backend
$(MAKE) frontend