Files
PG-admi-onefile/Makefile
2026-03-20 14:55:36 +07:00

76 lines
1.3 KiB
Makefile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Имя проекта (можно менять)
PROJECT_NAME=postgres_admin
# Файл compose
COMPOSE=docker-compose
# === Основные команды ===
# Сборка контейнеров
build:
$(COMPOSE) build
# Запуск (в фоне)
up:
$(COMPOSE) up -d
# Остановка
down:
$(COMPOSE) down
# Перезапуск
restart:
$(COMPOSE) down
$(COMPOSE) up -d
# Пересборка + запуск
rebuild:
$(COMPOSE) up -d --build
# === Логи ===
# Все логи
logs:
$(COMPOSE) logs -f
# Логи backend
logs-app:
$(COMPOSE) logs -f backend
# Логи базы
logs-db:
$(COMPOSE) logs -f postgres
# === Обслуживание ===
# Зайти в контейнер backend
bash:
$(COMPOSE) exec backend sh
# Зайти в postgres
psql:
$(COMPOSE) exec postgres psql -U postgres -d testdb
# Очистка (осторожно — удаляет данные!)
clean:
$(COMPOSE) down -v
docker system prune -f
# Полный ресет (жёстко)
reset:
$(COMPOSE) down -v --remove-orphans
docker system prune -af
# === Обновление ===
# Обновить код + пересобрать
update:
git pull
$(COMPOSE) up -d --build
# === Статус ===
# Проверить контейнеры
ps:
$(COMPOSE) ps