chg: pkg: make compatible the whole project with bare metal AND with docker #4
This commit is contained in:
48
Makefile
Normal file
48
Makefile
Normal file
@@ -0,0 +1,48 @@
|
||||
.PHONY: help start start-build stop build down ps logs prune-everything db-reset
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
help:
|
||||
@echo "Available commands:"
|
||||
@echo " make start - Start services without building (uses existing images)"
|
||||
@echo " make start-build - Start services and build images if needed"
|
||||
@echo " make stop - Stop running services"
|
||||
@echo " make build - Build Docker images only"
|
||||
@echo " make down - Stop and remove containers/networks"
|
||||
@echo " make prune-everything - Prune volumes, networks and images (DANGEROUS!)"
|
||||
@echo " make db-reset - Reset the database (drop, create, migrate) (DANGEROUS!)"
|
||||
|
||||
start:
|
||||
docker compose up -d
|
||||
|
||||
start-build:
|
||||
docker compose up -d --build
|
||||
|
||||
stop:
|
||||
docker compose stop
|
||||
|
||||
build:
|
||||
docker compose build
|
||||
|
||||
down:
|
||||
docker compose down
|
||||
|
||||
prune-everything:
|
||||
@echo "WARNING: This will remove ALL containers, volumes, networks and images!"
|
||||
@read -p "Type 'yes' to confirm: " confirm; \
|
||||
if [ "$$confirm" != "yes" ]; then \
|
||||
echo "Aborted."; \
|
||||
exit 1; \
|
||||
fi
|
||||
docker compose down -v --rmi all --remove-orphans
|
||||
|
||||
db-reset:
|
||||
@echo "WARNING: This will DROP and RECREATE the database!"
|
||||
@read -p "Type 'yes' to confirm: " confirm; \
|
||||
if [ "$$confirm" != "yes" ]; then \
|
||||
echo "Aborted."; \
|
||||
exit 1; \
|
||||
fi
|
||||
bin/console doctrine:database:drop --force --if-exists --no-interaction
|
||||
bin/console doctrine:database:create --if-not-exists --no-interaction
|
||||
bin/console doctrine:migrations:migrate --no-interaction
|
||||
Reference in New Issue
Block a user