|
|
|
NAME = inception
|
|
|
|
USER = narnaud
|
|
|
|
DATA_FOLDER = /home/$(USER)/data
|
|
|
|
CERT = $(DATA_FOLDER)/ssl/inception.pem
|
|
|
|
|
|
|
|
all: clean start
|
|
|
|
|
|
|
|
domain:
|
|
|
|
echo "127.0.0.1 $(USER).42.fr" >> /etc/hosts
|
|
|
|
|
|
|
|
hexo:
|
|
|
|
docker compose -f srcs/docker-compose.yml run hexo sh
|
|
|
|
|
|
|
|
$(CERT):
|
|
|
|
openssl req -newkey rsa:4096 -x509 -sha256 -days 365 -nodes \
|
|
|
|
-out inception.pem -keyout inception.pem \
|
|
|
|
-subj "/C=FR/ST=Nice/L=Nice/O=42/OU=student/CN=inception_$(USER)/"
|
|
|
|
mkdir -p $(DATA_FOLDER)/ssl
|
|
|
|
mv inception.pem $(DATA_FOLDER)/ssl
|
|
|
|
|
|
|
|
start: $(CERT)
|
|
|
|
mkdir -p $(DATA_FOLDER)/www/wordpress
|
|
|
|
docker compose -f srcs/docker-compose.yml up --build
|
|
|
|
|
|
|
|
debug: $(CERT)
|
|
|
|
BUILDKIT_PROGRESS=plain docker compose -f srcs/docker-compose.yml up --build
|
|
|
|
|
|
|
|
stop:
|
|
|
|
docker compose -f srcs/docker-compose.yml down
|
|
|
|
|
|
|
|
clean: stop
|
|
|
|
docker system prune -f
|
|
|
|
|
|
|
|
fclean: stop
|
|
|
|
docker system prune -af --volumes
|
|
|
|
|
|
|
|
wipe: stop
|
|
|
|
rm -rf $(DATA_FOLDER)
|
|
|
|
|
|
|
|
re: fclean start
|
|
|
|
|
|
|
|
.PHONY: all domain hexo start debug stop clean fclean
|