Docker story refactoring

This commit is contained in:
Markos Gogoulos
2025-11-15 15:01:39 +02:00
parent 9b3d9fe1e7
commit 66e67c751e
49 changed files with 2969 additions and 513 deletions

View File

@@ -1,4 +1,4 @@
.PHONY: admin-shell build-frontend
.PHONY: admin-shell build-frontend backup-db
admin-shell:
@container_id=$$(docker compose ps -q web); \
@@ -17,3 +17,16 @@ build-frontend:
test:
docker compose -f docker-compose-dev.yaml exec --env TESTING=True -T web pytest
backup-db:
@echo "Creating PostgreSQL database dump..."
@mkdir -p backups
@timestamp=$$(date +%Y%m%d_%H%M%S); \
dump_file="backups/mediacms_dump_$${timestamp}.sql"; \
docker compose exec -T db pg_dump -U mediacms -d mediacms > "$${dump_file}"; \
if [ $$? -eq 0 ]; then \
echo "Database dump created successfully: $${dump_file}"; \
else \
echo "Database dump failed"; \
exit 1; \
fi