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
|
# 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
|
# tags: finances,wallets,coins,stocks,investments,open,source
|
||||||
# logo: svgs/maybe.svg
|
# logo: svgs/maybe.svg
|
||||||
# port: 3000
|
# port: 3000
|
||||||
@@ -17,7 +17,7 @@ services:
|
|||||||
- GOOD_JOB_EXECUTION_MODE=${GOOD_JOB_EXECUTION_MODE:-async}
|
- GOOD_JOB_EXECUTION_MODE=${GOOD_JOB_EXECUTION_MODE:-async}
|
||||||
- SECRET_KEY_BASE=${SERVICE_BASE64_64_SECRETKEYBASE}
|
- SECRET_KEY_BASE=${SERVICE_BASE64_64_SECRETKEYBASE}
|
||||||
- DB_HOST=postgres
|
- DB_HOST=postgres
|
||||||
- POSTGRES_DB=${POSTGRES_DB:-maybe_db}
|
- POSTGRES_DB=${POSTGRES_DB:-maybe-db}
|
||||||
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
|
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
|
||||||
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
|
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
|
||||||
- DB_PORT=5432
|
- DB_PORT=5432
|
||||||
@@ -37,14 +37,14 @@ services:
|
|||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
image: "ghcr.io/maybe-finance/maybe:latest"
|
image: ghcr.io/maybe-finance/maybe:latest
|
||||||
command: "bundle exec sidekiq"
|
command: bundle exec sidekiq
|
||||||
exclude_from_hc: true
|
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
|
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
|
||||||
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_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}
|
- SECRET_KEY_BASE=${SERVICE_BASE64_64_SECRETKEYBASE}
|
||||||
- SELF_HOSTED=true
|
- SELF_HOSTED=true
|
||||||
- RAILS_FORCE_SSL=${RAILS_FORCE_SSL:-false}
|
- RAILS_FORCE_SSL=${RAILS_FORCE_SSL:-false}
|
||||||
@@ -59,30 +59,33 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
exclude_from_hc: true
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16
|
image: postgres:16-alpine
|
||||||
volumes:
|
volumes:
|
||||||
- maybe_postgres_data:/var/lib/postgresql/data
|
- maybe_postgres_data:/var/lib/postgresql/data
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
|
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
|
||||||
- POSTGRES_DB=${POSTGRES_DB:-maybe_db}
|
|
||||||
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
|
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
|
||||||
|
- POSTGRES_DB=${POSTGRES_DB:-maybe-db}
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 20s
|
timeout: 20s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:latest
|
image: redis:8-alpine
|
||||||
command: redis-server --appendonly yes --requirepass ${SERVICE_PASSWORD_REDIS}
|
command: redis-server --appendonly yes --requirepass ${SERVICE_PASSWORD_REDIS}
|
||||||
volumes:
|
volumes:
|
||||||
- redis_data:/data
|
- redis_data:/data
|
||||||
environment:
|
environment:
|
||||||
|
- REDIS_PASSWORD=${SERVICE_PASSWORD_REDIS}
|
||||||
- REDIS_PORT=6379
|
- REDIS_PORT=6379
|
||||||
- REDIS_DB=1
|
- REDIS_DB=1
|
||||||
- REDIS_PASSWORD=${SERVICE_PASSWORD_REDIS}
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
|
test: ["CMD", "redis-cli", "--pass", "${SERVICE_PASSWORD_REDIS}", "ping"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 3s
|
timeout: 3s
|
||||||
retries: 3
|
retries: 3
|
||||||
|
|||||||
Reference in New Issue
Block a user