mirror of
https://github.com/mediacms-io/mediacms.git
synced 2025-11-20 13:36:05 -05:00
Docker story refactoring
This commit is contained in:
15
Makefile
15
Makefile
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user