veza/make/config.mk

78 lines
2.5 KiB
Makefile
Raw Normal View History

2026-02-07 19:36:48 +00:00
# ==============================================================================
# VEZA MONOREPO - CONFIGURATION (single source of truth)
# ==============================================================================
# Edit this file to add services, change ports, or paths.
# Override via .env or environment (e.g. PORT_WEB=3000 make dev).
# ==============================================================================
-include .env
# --- Project ---
PROJECT_NAME ?= veza
ROOT ?= $(CURDIR)
# --- Compose ---
COMPOSE_FILE ?= docker-compose.yml
COMPOSE_PROD ?= docker-compose.prod.yml
# --- Services (space-separated; must match keys in SERVICE_DIRS / SERVICE_PORTS)
SERVICES := backend-api stream-server web haproxy
2026-02-07 19:36:48 +00:00
INFRA_SERVICES := postgres redis rabbitmq
# --- Service → Directory mapping (customize paths here)
SERVICE_DIR_backend-api := veza-backend-api
SERVICE_DIR_stream-server := veza-stream-server
SERVICE_DIR_web := apps/web
SERVICE_DIR_haproxy :=
# --- Ports (override with PORT_* from .env)
# Defaults use 18xxx range to avoid conflicts with other projects on same machine
PORT_backend-api ?= 18080
PORT_stream-server ?= 18082
2026-02-07 19:36:48 +00:00
PORT_web ?= 5173
PORT_haproxy ?= 80
# Infra (docker-compose dev)
PORT_POSTGRES ?= 15432
PORT_REDIS ?= 16379
PORT_RABBITMQ_AMQP ?= 15672
PORT_RABBITMQ_MGMT ?= 25672
PORT_BACKEND ?= 18080
2026-02-07 19:36:48 +00:00
# Exposed host port for Stream (Docker dev)
PORT_STREAM ?= 18082
2026-02-07 19:36:48 +00:00
# Legacy names for backward compatibility
PORT_GO ?= $(PORT_backend-api)
PORT_WEB ?= $(PORT_web)
PORT_HAPROXY ?= $(PORT_haproxy)
# --- Domain (single source of truth — override via APP_DOMAIN=... env) ---
APP_DOMAIN ?= veza.fr
2026-02-07 19:36:48 +00:00
# --- Database & Infra ---
# Host ports when using docker-compose (override in .env if needed)
2026-02-07 19:36:48 +00:00
DB_USER ?= veza
DB_PASS ?= password
DB_NAME ?= veza
DB_HOST ?= $(APP_DOMAIN)
DB_PORT ?= $(PORT_POSTGRES)
2026-02-07 19:36:48 +00:00
# Connection strings for backend running on host connecting to Docker infra
# In Docker: backend uses postgres:5432, redis:6379, rabbitmq:5672 (internal)
# On host: use mapped ports from env (15432, 16379, 15672)
2026-02-07 19:36:48 +00:00
DATABASE_URL = postgres://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)?sslmode=disable
REDIS_URL = redis://$(APP_DOMAIN):$(PORT_REDIS)
AMQP_URL = amqp://$(DB_USER):$(DB_PASS)@$(APP_DOMAIN):$(PORT_RABBITMQ_AMQP)/
2026-02-07 19:36:48 +00:00
# --- Incus ---
DEPLOY_TARGET ?= docker
INCUS_PROFILE ?= veza-profile
INCUS_NETWORK ?= veza-network
INCUS_SCRIPTS ?= $(ROOT)/config/incus
# --- NPM workspaces (from root package.json; used for install-deps / lint scope)
NPM_WORKSPACES ?= apps/web packages/design-system
# --- Scripts ---
SCRIPTS ?= $(ROOT)/scripts