lot of small changes in makefile and conf files, but ssl doesnt work so far

This commit is contained in:
hugo gogo
2022-09-01 00:32:24 +02:00
parent 5fa7bb5a79
commit b0a0a2fbd6
6 changed files with 51 additions and 48 deletions

View File

@@ -35,9 +35,15 @@ VOLUMES = v_wp_site \
CONTAINERS = $(IMAGES:%=my%)
SUDO =
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# use 'make' to launch and relaunch the project #
# use 'make re' to relaunch and clean the dungling images #
# use 'make fre' to start all over again (images) #
# use 'make super-clean' if you want to delete all dockers on com- #
# puter even if not related to the project #
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
all: build $(VOLUMES_D) up
@@ -46,60 +52,53 @@ $(VOLUMES_D):
mkdir -p $(VOLUMES_D)
build:
sudo docker-compose -f $(COMPOSE) build
$(SUDO) docker-compose -f $(COMPOSE) build
up: $(VOLUMES_D)
sudo docker-compose -f $(COMPOSE) up -d
$(SUDO) docker-compose -f $(COMPOSE) up -d
# list images, containers, volumes
list:
@echo $(B_YELLOW)"\nimages:"$(RESET)
@sudo docker images -a
@$(SUDO) docker images -a
@echo $(B_YELLOW)"\ncontainers:"$(RESET)
@sudo docker ps -a
@$(SUDO) docker ps -a
@echo $(B_YELLOW)"\nvolumes:"$(RESET)
@sudo docker volume ls
@$(SUDO) docker volume ls
@echo ""
# remove project images
rm-images:
sudo docker image rm -f $(IMAGES)
$(SUDO) docker image rm -f $(IMAGES)
# stop project containers
stop:
- sudo docker stop $(CONTAINERS)
- $(SUDO) docker stop $(CONTAINERS)
# remove project containers
rm-containers: stop
- sudo docker rm $(CONTAINERS)
# close nginx
close-nginx:
- sudo nginx -s quit
# remove all stopped containers and dangling images (dangling images, see : https://projectatomic.io/blog/2015/07/what-are-docker-none-none-images/)
prune:
$(SUDO) docker system prune -f
# remove project images and containers
clean: stop rm-containers close-nginx
clean: stop prune
# remove project volumes
rm-volumes:
- sudo docker volume rm -f $(VOLUMES)
- $(SUDO) docker volume rm -f $(VOLUMES)
/bin/rm -rf $(VOLUMES_D)
# remove project
fclean: rm-images clean rm-volumes
# remove all containers and related files that are not runnings
prune:
sudo docker system prune -af --volumes
# remove all dockers, even not related to the project
super-clean:
- $(SUDO) docker stop $(sudo docker ps -q)
$(SUDO) docker system prune -af --volumes
/bin/rm -rf $(VOLUMES_D)
# remove all containers and related files
fprune:
sudo docker stop $(sudo docker ps -q)
sudo docker system prune -af --volumes
/bin/rm -rf $(VOLUMES_D)
re: clean all
re: fclean all
fre: fclean all
.PHONY : all build up $(VOLUMES_D) list rm-images stop rm-containers close-nginx clean rm-volumes fclean prune fprune re
.PHONY : all build up $(VOLUMES_D) list rm-images stop rm-containers close-nginx prune clean rm-volumes fclean super-clean re fre