Files
computer-playbook/roles/web-app-magento/Administration.md
Kevin Veen-Birkenbach 0e72dcbe36 feat(magento): switch to ghcr.io/alexcheng1982/docker-magento2:2.4.6-p3; update Compose/Env/Tasks/Docs
• Docs: updated to MAGENTO_VOLUME; removed Installation/User_Administration guides
• Compose: volume path → /var/www/html; switched variables to MAGENTO_*/MYSQL_*/OPENSEARCH_*
• Env: new variable set + APACHE_SERVERNAME
• Task: setup:install via docker compose exec (multiline form)
• Schema: removed obsolete credentials definition
Link: https://chatgpt.com/share/68b8dc30-361c-800f-aa69-88df514cb160
2025-09-04 02:25:49 +02:00

1.5 KiB

Administration

🗑️ Cleanup (Remove Instance & Volumes)

cd {{ PATH_DOCKER_COMPOSE_INSTANCES }}magento/
docker compose down
docker volume rm MAGENTO_VOLUME
cd {{ PATH_DOCKER_COMPOSE_INSTANCES }} && rm -vR {{ PATH_DOCKER_COMPOSE_INSTANCES }}magento

🔍 Access Container Shell

docker compose exec -it application /bin/bash

🧰 Common Magento CLI Tasks

# Reindex
docker compose exec -it application bin/magento indexer:reindex

# Flush caches
docker compose exec -it application bin/magento cache:flush

# Enable maintenance mode
docker compose exec -it application bin/magento maintenance:enable

# Disable maintenance mode
docker compose exec -it application bin/magento maintenance:disable

# Recompile DI (when switching modes)
docker compose exec -it application bin/magento setup:di:compile

# Deploy static content (example for English/German)
docker compose exec -it application bin/magento setup:static-content:deploy en_US de_DE -f

🚀 Performance

# Production mode
docker compose exec -it application bin/magento deploy:mode:set production

# Developer mode
docker compose exec -it application bin/magento deploy:mode:set developer

🔐 Admin User

# Create another admin (example)
docker compose exec -it application bin/magento admin:user:create \
  --admin-user="admin2" \
  --admin-password="ChangeMe_12345" \
  --admin-email="{{ users.administrator.email }}" \
  --admin-firstname="Admin" \
  --admin-lastname="User"