-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (43 loc) · 1.13 KB
/
Makefile
File metadata and controls
51 lines (43 loc) · 1.13 KB
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
# Makefile for Inception project
# Directory containing docker-compose.yml
DOCKER_COMPOSE_DIR := srcs
DOCKER_COMPOSE := docker compose -f $(DOCKER_COMPOSE_DIR)/docker-compose.yml
# Build Docker images
.PHONY: build
build:
@echo "Building Docker images..."
$(DOCKER_COMPOSE) build
# Start services in detached mode
.PHONY: up
up:
@echo "Starting services..."
$(DOCKER_COMPOSE) up -d --build
# Stop services (preserve volumes)
.PHONY: down
down:
@echo "Stopping services (preserving volumes)..."
$(DOCKER_COMPOSE) down
# Full reset: stop, remove volumes & images, rebuild & start
.PHONY: clear
clear:
@echo "clear..."
$(DOCKER_COMPOSE) down -v --volumes --rmi all --remove-orphans
docker volume prune -f
sudo rm -rf /home/linus/data/www/*
sudo rm -rf /home/linus/data/db/*
# Tail logs for all services
.PHONY: logs
logs:
@echo "Showing logs (press Ctrl+C to exit)..."
$(DOCKER_COMPOSE) logs -f
# Open a shell in the MariaDB container
.PHONY: mshell
mshell:
@echo "Opening shell in MariaDB container..."
docker exec -it mariadb bash
.PHONY: wshell
wshell:
docker exec -it wordpress bash
.PHONY: nshell
nshell:
docker exec -it nginx bash