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:
@@ -1,3 +1,6 @@
|
|||||||
|
# Which services to run. Everything is behind a profile: db, gateway, obsidian.
|
||||||
|
COMPOSE_PROFILES=db,gateway,obsidian
|
||||||
|
|
||||||
GATEWAY_REF=main
|
GATEWAY_REF=main
|
||||||
|
|
||||||
# Uncomment when developing against a sibling ../beaver-gateway checkout.
|
# Uncomment when developing against a sibling ../beaver-gateway checkout.
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ config.json
|
|||||||
.venv/
|
.venv/
|
||||||
__pycache__/
|
__pycache__/
|
||||||
.idea
|
.idea
|
||||||
|
docker-compose.override.yml
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
%:
|
||||||
|
@:
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# Local overrides, not committed. Copy to docker-compose.override.yml.
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:5432:5432"
|
||||||
@@ -4,6 +4,7 @@ x-restart: &restart
|
|||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
|
profiles: [db]
|
||||||
<<: *restart
|
<<: *restart
|
||||||
env_file: .env
|
env_file: .env
|
||||||
volumes:
|
volumes:
|
||||||
@@ -21,6 +22,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
dockerfile: obsidian.Dockerfile
|
dockerfile: obsidian.Dockerfile
|
||||||
|
profiles: [obsidian]
|
||||||
<<: *restart
|
<<: *restart
|
||||||
volumes:
|
volumes:
|
||||||
- vault:/vault
|
- vault:/vault
|
||||||
@@ -31,6 +33,7 @@ services:
|
|||||||
container_name: beaver-gateway
|
container_name: beaver-gateway
|
||||||
build:
|
build:
|
||||||
context: https://git.kotikot.com/beaver/beaver-gateway.git#${GATEWAY_REF:-main}
|
context: https://git.kotikot.com/beaver/beaver-gateway.git#${GATEWAY_REF:-main}
|
||||||
|
profiles: [gateway]
|
||||||
<<: *restart
|
<<: *restart
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
|
|||||||
Reference in New Issue
Block a user