feat: add forage and nats

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2026-03-21 01:13:25 +01:00
parent 4b10981952
commit 8157c30c08
2 changed files with 65 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
services:
forest:
image: docker.io/kasperhermansen/forest-server:${FOREST_IMAGE_VERSION:-main}
image: git.kjuulh.io/kasperhermansen/forest:${FOREST_IMAGE_VERSION:-main}
restart: always
env_file: ".env"
command: |
@@ -24,6 +24,41 @@ services:
postgres:
condition: service_healthy
restart: true
nats:
condition: service_healthy
restart: true
forage:
image: git.kjuulh.io/forage/client::${FORAGE_IMAGE_VERSION:-main}
restart: always
env_file: ".env"
command: |
/app/forage serve
ports:
- "3000:3000"
environment:
RUST_LOG: "forage=debug,info"
LOG_LEVEL: short
FORAGE_HOST: 0.0.0.0:3000
networks:
- public
- internal
healthcheck:
test: ["CMD", "/app/forage", "--external-host", "http://127.0.0.1:3000", "admin", "status"]
interval: 10s
timeout: 10s
retries: 3
start_period: 30s
depends_on:
forest:
condition: service_healthy
restart: true
postgres:
condition: service_healthy
restart: true
nats:
condition: service_healthy
restart: true
postgres:
image: postgres:18
@@ -34,6 +69,7 @@ services:
- internal
volumes:
- ./data/postgres/18:/var/lib/postgresql/18/docker
- ./init-databases.sh:/docker-entrypoint-initdb.d/init-databases.sh
environment:
POSTGRES_USER: forest
POSTGRES_DB: forest
@@ -56,7 +92,7 @@ services:
- internal
environment:
- POSTGRES_HOST=postgres
- POSTGRES_DB=forest
- POSTGRES_DB=forest,forage
- POSTGRES_USER=forest
- POSTGRES_EXTRA_OPTS=-Z1 --schema=public --blobs
- BACKUP_ON_START=TRUE
@@ -66,6 +102,26 @@ services:
- BACKUP_KEEP_MONTHS=6 # keep monthly backups for 6 months
- HEALTHCHECK_PORT=8080
nats:
image: nats:2-alpine
restart: always
command: |
-js -sd /data
networks:
- internal
ports:
- 4222:4222
- 6222:6222
- 8222:8222
volumes:
./data/nats/data:/data
healthcheck:
test: wget http://localhost:8222/healthz -q -S -O -
start_period: 3s
retries: 3
timeout: 3s
interval: 14s
networks:
public:
internal: