feat(infra): compose profiles, Makefile, local override example

All services sit behind profiles (db, gateway, obsidian) selected via
COMPOSE_PROFILES in .env; Makefile with the usual verbs and a `deploy`
target that pushes main:stable.
This commit is contained in:
hh
2026-08-27 23:21:31 +02:00
parent 967cc82ee6
commit 6410efbe03
5 changed files with 45 additions and 0 deletions
+3
View File
@@ -1,3 +1,6 @@
# Which services to run. Everything is behind a profile: db, gateway, obsidian.
COMPOSE_PROFILES=db,gateway,obsidian
GATEWAY_REF=main
# Uncomment when developing against a sibling ../beaver-gateway checkout.
+1
View File
@@ -3,3 +3,4 @@ config.json
.venv/
__pycache__/
.idea
docker-compose.override.yml
+33
View File
@@ -0,0 +1,33 @@
.PHONY: up recreate down restart rebuild gateway logs shell deploy
up:
docker compose up -d
recreate:
docker compose up -d --force-recreate
down:
docker compose down
restart:
$(MAKE) recreate
rebuild:
docker compose build
docker compose up -d
gateway:
docker compose build gateway
docker compose up -d gateway
logs:
docker compose logs -f $(filter-out $@,$(MAKECMDGOALS))
shell:
docker exec -it beaver-gateway bash
deploy:
git push origin main:stable
%:
@:
+5
View File
@@ -0,0 +1,5 @@
# Local overrides, not committed. Copy to docker-compose.override.yml.
services:
postgres:
ports:
- "127.0.0.1:5432:5432"
+3
View File
@@ -4,6 +4,7 @@ x-restart: &restart
services:
postgres:
image: postgres:16-alpine
profiles: [db]
<<: *restart
env_file: .env
volumes:
@@ -21,6 +22,7 @@ services:
build:
context: .
dockerfile: obsidian.Dockerfile
profiles: [obsidian]
<<: *restart
volumes:
- vault:/vault
@@ -31,6 +33,7 @@ services:
container_name: beaver-gateway
build:
context: https://git.kotikot.com/beaver/beaver-gateway.git#${GATEWAY_REF:-main}
profiles: [gateway]
<<: *restart
depends_on:
postgres: