Override-based compose, profiles in .env, README

This commit is contained in:
hh
2026-09-09 00:18:15 +02:00
parent 1f416dbe60
commit ac0ccf47e5
13 changed files with 131 additions and 88 deletions
+10 -13
View File
@@ -6,10 +6,8 @@
{%- if 'scheduler' in backend_services and 'taskiq_worker' not in backend_services %}{% set _ = svc_modules.append("scheduler") %}{% endif -%}
{%- set has_script = dynamic_config and svc_modules -%}
COMPOSE := docker compose{% if layout == 'part' %} --project-directory ..{% endif %}
{% if layout == 'root' %}SERVICES := $(COMPOSE) --profile services
EXTERNAL := $(COMPOSE) --profile external
{% endif %}
.PHONY: {% if layout == 'root' %}env external recreate rebuild restart logs down {% endif %}fmt check build{% if database == 'postgres' %} migrate revision{% endif %}{% if has_script %} script{% endif %}{% if 'kurigram_userbot' in backend_services %} session{% endif %}
.PHONY: {% if layout == 'root' %}env recreate rebuild restart logs down {% endif %}fmt check build{% if database == 'postgres' %} migrate revision{% endif %}{% if has_script %} script{% endif %}{% if 'kurigram_userbot' in backend_services %} session{% endif %}
fmt:
uv run ruff format
@@ -25,23 +23,22 @@ build:
{% if layout == 'root' %}
env:
@test -f .env || cp .env.example .env
@test -f docker-compose.override.yml || cp docker-compose.override.yml.example docker-compose.override.yml
external:
$(EXTERNAL) up -d
recreate:
$(COMPOSE) up -d --force-recreate
recreate: external
$(SERVICES) up -d --force-recreate
rebuild: build recreate
rebuild: build
$(COMPOSE) up -d
restart:
$(SERVICES) restart
$(COMPOSE) restart
logs:
$(SERVICES) logs -f --tail=100
$(COMPOSE) logs -f --tail=100
down:
$(EXTERNAL) --profile services down
$(COMPOSE) down
{% endif %}{% if database == 'postgres' %}
migrate:
$(COMPOSE) --profile external run --rm migrator