@@ -1,6 +1,6 @@
|
|||||||
services:
|
services:
|
||||||
forest:
|
forest:
|
||||||
image: docker.io/kasperhermansen/forest-server:${FOREST_IMAGE_VERSION:-main}
|
image: git.kjuulh.io/kasperhermansen/forest:${FOREST_IMAGE_VERSION:-main}
|
||||||
restart: always
|
restart: always
|
||||||
env_file: ".env"
|
env_file: ".env"
|
||||||
command: |
|
command: |
|
||||||
@@ -24,6 +24,41 @@ services:
|
|||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
restart: true
|
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:
|
postgres:
|
||||||
image: postgres:18
|
image: postgres:18
|
||||||
@@ -34,6 +69,7 @@ services:
|
|||||||
- internal
|
- internal
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/postgres/18:/var/lib/postgresql/18/docker
|
- ./data/postgres/18:/var/lib/postgresql/18/docker
|
||||||
|
- ./init-databases.sh:/docker-entrypoint-initdb.d/init-databases.sh
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: forest
|
POSTGRES_USER: forest
|
||||||
POSTGRES_DB: forest
|
POSTGRES_DB: forest
|
||||||
@@ -56,7 +92,7 @@ services:
|
|||||||
- internal
|
- internal
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_HOST=postgres
|
- POSTGRES_HOST=postgres
|
||||||
- POSTGRES_DB=forest
|
- POSTGRES_DB=forest,forage
|
||||||
- POSTGRES_USER=forest
|
- POSTGRES_USER=forest
|
||||||
- POSTGRES_EXTRA_OPTS=-Z1 --schema=public --blobs
|
- POSTGRES_EXTRA_OPTS=-Z1 --schema=public --blobs
|
||||||
- BACKUP_ON_START=TRUE
|
- BACKUP_ON_START=TRUE
|
||||||
@@ -66,6 +102,26 @@ services:
|
|||||||
- BACKUP_KEEP_MONTHS=6 # keep monthly backups for 6 months
|
- BACKUP_KEEP_MONTHS=6 # keep monthly backups for 6 months
|
||||||
- HEALTHCHECK_PORT=8080
|
- 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:
|
networks:
|
||||||
public:
|
public:
|
||||||
internal:
|
internal:
|
||||||
|
|||||||
7
init-databases.sh
Executable file
7
init-databases.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
||||||
|
CREATE USER forage WITH PASSWORD '$FORAGE_POSTGRES_PASSWORD';
|
||||||
|
CREATE DATABASE forage OWNER forage;
|
||||||
|
EOSQL
|
||||||
Reference in New Issue
Block a user