mirror of
https://github.com/usetrmnl/terminus.git
synced 2026-08-13 14:29:27 -07:00
link:https://www.postgresql.org/about/news/postgresql-184-1710-1614-1518-and-1423-released-3297/[Details]. Milestone: minor
132 lines
3.4 KiB
YAML
132 lines
3.4 KiB
YAML
name: "terminus"
|
|
|
|
services:
|
|
init-certificates:
|
|
image: ghcr.io/usetrmnl/terminus:latest
|
|
user: root
|
|
environment:
|
|
CERTIFICATE_URLS: ${CERTIFICATE_URLS:-}
|
|
volumes:
|
|
- certificates:/etc/ssl/certs
|
|
entrypoint: ["/bin/bash", "-c"]
|
|
command: scripts/docker/install-certificates
|
|
restart: no
|
|
|
|
web:
|
|
init: true
|
|
image: ghcr.io/usetrmnl/terminus:latest
|
|
environment:
|
|
HANAMI_PORT: ${HANAMI_PORT}
|
|
API_URI: ${API_URI}
|
|
APP_SECRET: ${APP_SECRET}
|
|
APP_SETUP: true
|
|
DATABASE_URL: postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@database:${DATABASE_PORT}/${DATABASE_NAME}
|
|
KEYVALUE_URL: redis://:${KEYVALUE_PASSWORD}@keyvalue:${KEYVALUE_PORT}/${KEYVALUE_DATABASE}
|
|
ports:
|
|
- "${HANAMI_PORT}:${HANAMI_PORT}"
|
|
restart: unless-stopped
|
|
volumes:
|
|
- certificates:/etc/ssl/certs
|
|
- web-uploads:/app/public/uploads
|
|
depends_on:
|
|
init-certificates:
|
|
condition: service_completed_successfully
|
|
database:
|
|
condition: service_healthy
|
|
keyvalue:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl --fail --silent http://localhost:${HANAMI_PORT}/up"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 45s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 1G
|
|
cpus: "1.0"
|
|
|
|
worker:
|
|
init: true
|
|
image: ghcr.io/usetrmnl/terminus:latest
|
|
environment:
|
|
HANAMI_PORT: ${HANAMI_PORT}
|
|
API_URI: ${API_URI}
|
|
APP_SECRET: ${APP_SECRET}
|
|
DATABASE_URL: postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@database:${DATABASE_PORT}/${DATABASE_NAME}
|
|
KEYVALUE_URL: redis://:${KEYVALUE_PASSWORD}@keyvalue:${KEYVALUE_PORT}/${KEYVALUE_DATABASE}
|
|
command: bundle exec sidekiq -r ./config/sidekiq.rb
|
|
restart: unless-stopped
|
|
volumes:
|
|
- certificates:/etc/ssl/certs
|
|
- web-uploads:/app/public/uploads
|
|
depends_on:
|
|
web:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "pgrep", "-f", "sidekiq"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 45s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 1G
|
|
cpus: "1.0"
|
|
|
|
database:
|
|
image: postgres:18.4-alpine
|
|
environment:
|
|
POSTGRES_USER: ${DATABASE_USER}
|
|
POSTGRES_DB: ${DATABASE_NAME}
|
|
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
|
|
ports:
|
|
- "${DATABASE_PORT}:${DATABASE_PORT}"
|
|
volumes:
|
|
- database-data:/var/lib/postgresql
|
|
command: -p ${DATABASE_PORT}
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready --username ${DATABASE_USER} --dbname ${DATABASE_NAME} --port ${DATABASE_PORT}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 2G
|
|
cpus: "1.0"
|
|
|
|
keyvalue:
|
|
image: valkey/valkey:9-alpine
|
|
ports:
|
|
- "${KEYVALUE_PORT}:${KEYVALUE_PORT}"
|
|
command: >
|
|
valkey-server
|
|
--requirepass ${KEYVALUE_PASSWORD}
|
|
--maxmemory 512mb
|
|
--maxmemory-policy noeviction
|
|
--port ${KEYVALUE_PORT}
|
|
restart: unless-stopped
|
|
volumes:
|
|
- keyvalue-data:/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "redis-cli -p ${KEYVALUE_PORT} ping || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 2s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
cpus: "0.5"
|
|
|
|
volumes:
|
|
database-data:
|
|
keyvalue-data:
|
|
web-uploads:
|
|
certificates:
|