-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
39 lines (31 loc) · 1.08 KB
/
makefile
File metadata and controls
39 lines (31 loc) · 1.08 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
NAME = inception
CONFIGS_FOLDER = ./srcs/requirements
COMPOSE_FILE = ./srcs/docker-compose.yml
ENV = ./srcs/.env
BASEYML = ./srcs/tools/base.yml
LOGIN = $(shell whoami)
all: build run
# Build the docker images in the docker-compose.yml file
build:
mkdir -p ~/data/mariadb
mkdir -p ~/data/wordpress
sudo docker-compose -f $(COMPOSE_FILE) build
@echo "\n\nInception is ready to be launched."
# Run the docker containers in the docker-compose.yml file
run:
sudo docker-compose -f $(COMPOSE_FILE) up -d
@echo "\n\nInception is now running on https://${LOGIN}.42.fr."
stop:
sudo docker-compose -f $(COMPOSE_FILE) stop
# Launch the tests
test: build run
# Stop and remove the docker containers
clean: stop
sudo docker-compose -f $(COMPOSE_FILE) down -v
# Remove the docker images
fclean: clean
@if [ -n "$$(sudo docker ps -a -q)" ]; then sudo docker rm -f $$(sudo docker ps -a -q); fi
@if [ -n "$$(sudo docker images -q)" ]; then sudo docker rmi -f $$(sudo docker images -q); fi
@if [ -n "$$(sudo docker volume ls -q)" ]; then sudo docker volume prune -f; fi
sudo rm -rf ~/data/*
re: fclean all