refactor(service): improve maybe
- Use alpine DB variants for much smaller image sizes - Improve healthcheck for Redis - adjust naming and formatting
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# documentation: https://github.com/maybe-finance/maybe
|
||||
# slogan: Maybe: The OS for your personal finances.
|
||||
# slogan: Maybe, the OS for your personal finances.
|
||||
# tags: finances,wallets,coins,stocks,investments,open,source
|
||||
# logo: svgs/maybe.svg
|
||||
# port: 3000
|
||||
@@ -17,7 +17,7 @@ services:
|
||||
- GOOD_JOB_EXECUTION_MODE=${GOOD_JOB_EXECUTION_MODE:-async}
|
||||
- SECRET_KEY_BASE=${SERVICE_BASE64_64_SECRETKEYBASE}
|
||||
- DB_HOST=postgres
|
||||
- POSTGRES_DB=${POSTGRES_DB:-maybe_db}
|
||||
- POSTGRES_DB=${POSTGRES_DB:-maybe-db}
|
||||
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
|
||||
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
|
||||
- DB_PORT=5432
|
||||
@@ -37,14 +37,14 @@ services:
|
||||
interval: 10s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
|
||||
worker:
|
||||
image: "ghcr.io/maybe-finance/maybe:latest"
|
||||
command: "bundle exec sidekiq"
|
||||
exclude_from_hc: true
|
||||
image: ghcr.io/maybe-finance/maybe:latest
|
||||
command: bundle exec sidekiq
|
||||
environment:
|
||||
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
|
||||
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
|
||||
- POSTGRES_DB=${POSTGRES_DB:-maybe_db}
|
||||
- POSTGRES_DB=${POSTGRES_DB:-maybe-db}
|
||||
- SECRET_KEY_BASE=${SERVICE_BASE64_64_SECRETKEYBASE}
|
||||
- SELF_HOSTED=true
|
||||
- RAILS_FORCE_SSL=${RAILS_FORCE_SSL:-false}
|
||||
@@ -59,30 +59,33 @@ services:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
exclude_from_hc: true
|
||||
|
||||
postgres:
|
||||
image: postgres:16
|
||||
image: postgres:16-alpine
|
||||
volumes:
|
||||
- maybe_postgres_data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
|
||||
- POSTGRES_DB=${POSTGRES_DB:-maybe_db}
|
||||
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
|
||||
- POSTGRES_DB=${POSTGRES_DB:-maybe-db}
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
||||
interval: 5s
|
||||
timeout: 20s
|
||||
retries: 10
|
||||
|
||||
redis:
|
||||
image: redis:latest
|
||||
image: redis:8-alpine
|
||||
command: redis-server --appendonly yes --requirepass ${SERVICE_PASSWORD_REDIS}
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
environment:
|
||||
- REDIS_PASSWORD=${SERVICE_PASSWORD_REDIS}
|
||||
- REDIS_PORT=6379
|
||||
- REDIS_DB=1
|
||||
- REDIS_PASSWORD=${SERVICE_PASSWORD_REDIS}
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
|
||||
test: ["CMD", "redis-cli", "--pass", "${SERVICE_PASSWORD_REDIS}", "ping"]
|
||||
interval: 10s
|
||||
timeout: 3s
|
||||
retries: 3
|
||||
|
||||
Reference in New Issue
Block a user