chore(docker): dockerize app, add workflow to push image on gitea registry
This commit is contained in:
61
Makefile
Normal file
61
Makefile
Normal file
@@ -0,0 +1,61 @@
|
||||
REGISTRY := git.lclr.dev
|
||||
SHELL := /bin/bash
|
||||
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
docker\:build: ## Build les images en local
|
||||
docker compose build
|
||||
|
||||
docker\:push: ## Build et push les images vers le registry Gitea
|
||||
docker compose build
|
||||
docker compose push
|
||||
|
||||
docker\:pull: ## Pull les images depuis le registry Gitea
|
||||
docker compose pull
|
||||
|
||||
docker\:login: ## Connexion au registry Gitea
|
||||
docker login $(REGISTRY)
|
||||
|
||||
dev\:up: ## Démarre l'environnement de développement
|
||||
docker compose up --build -d
|
||||
|
||||
dev\:down: ## Arrête l'environnement de développement
|
||||
docker compose down
|
||||
|
||||
dev\:logs: ## Affiche les logs en temps réel
|
||||
docker compose logs -f
|
||||
|
||||
dev\:shell: ## Ouvre un shell dans le conteneur app
|
||||
docker compose exec app sh
|
||||
|
||||
prod\:up: ## Démarre en production (pull depuis le registry)
|
||||
docker compose -f docker-compose.yaml pull
|
||||
docker compose -f docker-compose.yaml up -d
|
||||
|
||||
prod\:down: ## Arrête la production
|
||||
docker compose -f docker-compose.yaml down
|
||||
|
||||
db\:migrate: ## Exécute les migrations Doctrine
|
||||
docker compose exec app php bin/console doctrine:migrations:migrate --no-interaction
|
||||
|
||||
db\:migration: ## Génère une nouvelle migration depuis les entités
|
||||
docker compose exec app php bin/console doctrine:migrations:diff --no-interaction
|
||||
|
||||
db\:reset: ## Recrée la base et rejoue les migrations (⚠ perd les données)
|
||||
docker compose exec app php bin/console doctrine:database:drop --force --no-interaction
|
||||
docker compose exec app php bin/console doctrine:database:create --no-interaction
|
||||
docker compose exec app php bin/console doctrine:migrations:migrate --no-interaction
|
||||
|
||||
symfony\:console: ## Lance une commande Symfony (ex: make symfony:console CMD="cache:clear")
|
||||
docker compose exec app php bin/console $(CMD)
|
||||
|
||||
symfony\:cache-clear: ## Vide le cache Symfony
|
||||
docker compose exec app php bin/console cache:clear
|
||||
|
||||
test: ## Lance les tests PHPUnit
|
||||
docker compose exec app php bin/phpunit
|
||||
|
||||
help: ## Affiche cette aide
|
||||
@grep -E '^[a-zA-Z_\\:-]+:.*## ' $(MAKEFILE_LIST) \
|
||||
| awk 'BEGIN {FS = "## "} {gsub(/\\:/, ":", $$1); sub(/:[^:]*$$/, "", $$1); printf "\033[36m%-25s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
Reference in New Issue
Block a user