-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (32 loc) · 1.07 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
up: check_env
# $(eval VOLUME_PATH := $(HOME)/volumes)
# mkdir -p $(HOME)/volumes/grafana
# mkdir -p $(HOME)/volumes/prometheus
open https://localhost:8443/ || true
# @open https://localhost:3000/ || true
# @open http://localhost:9090/ || true
# @echo "Open: https://localhost:8443/"
docker compose up
check_env:
@if [ ! -f ".env" ]; then \
./srcs/check_env.sh; \
fi
down:
docker compose down
clean:
@docker compose down --volumes
@echo "Stopping and removing specific containers..."
@docker stop pong42-nginx pong42-backend postgres > /dev/null 2>&1 || true
@docker rm pong42-nginx pong42-backend postgres > /dev/null 2>&1 || true
@docker image rm pong42-nginx pong42-backend postgres > /dev/null 2>&1 || true
@echo "Removing volumes associated with the containers..."
@VOLUMES=$$(docker volume ls -q | grep -E 'pong42-(nginx|backend|postgres)'); \
if [ -n "$$VOLUMES" ]; then \
docker volume rm $$VOLUMES > /dev/null 2>&1; \
else \
echo "No volumes to remove."; \
fi
@echo "Clean-up done."
re: down check_env
docker compose up --build
.PHONY: re clean up down