mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
100 lines
2.5 KiB
YAML
100 lines
2.5 KiB
YAML
|
# ===========================================================================
|
||
|
# Example Docker Compose file
|
||
|
# ===========================================================================
|
||
|
#
|
||
|
# Purpose:
|
||
|
# --------
|
||
|
#
|
||
|
# This file is an example Docker Compose configuration for self hosting
|
||
|
# Maybe on your local machine or on a cloud VPS.
|
||
|
#
|
||
|
# The configuration below is a "standard" setup that works out of the box,
|
||
|
# but if you're running this outside of a local network, it is recommended
|
||
|
# to set the environment variables for extra security.
|
||
|
#
|
||
|
# Setup:
|
||
|
# ------
|
||
|
#
|
||
|
# To run this, you should read the setup guide:
|
||
|
#
|
||
|
# https://github.com/maybe-finance/maybe/blob/main/docs/hosting/docker.md
|
||
|
#
|
||
|
# Troubleshooting:
|
||
|
# ----------------
|
||
|
#
|
||
|
# If you run into problems, you should open a Discussion here:
|
||
|
#
|
||
|
# https://github.com/maybe-finance/maybe/discussions/categories/general
|
||
|
#
|
||
|
|
||
|
x-db-env: &db_env
|
||
|
POSTGRES_USER: ${POSTGRES_USER:-maybe_user}
|
||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-maybe_password}
|
||
|
POSTGRES_DB: ${POSTGRES_DB:-maybe_production}
|
||
|
|
||
|
x-rails-env: &rails_env
|
||
|
<<: *db_env
|
||
|
SECRET_KEY_BASE: ${SECRET_KEY_BASE:-a7523c3d0ae56415046ad8abae168d71074a79534a7062258f8d1d51ac2f76d3c3bc86d86b6b0b307df30d9a6a90a2066a3fa9e67c5e6f374dbd7dd4e0778e13}
|
||
|
SELF_HOSTED: "true"
|
||
|
RAILS_FORCE_SSL: "false"
|
||
|
RAILS_ASSUME_SSL: "false"
|
||
|
DB_HOST: db
|
||
|
DB_PORT: 5432
|
||
|
REDIS_URL: redis://redis:6379/1
|
||
|
|
||
|
services:
|
||
|
web:
|
||
|
image: ghcr.io/maybe-finance/maybe:latest
|
||
|
volumes:
|
||
|
- app-storage:/rails/storage
|
||
|
ports:
|
||
|
- 3000:3000
|
||
|
restart: unless-stopped
|
||
|
environment:
|
||
|
<<: *rails_env
|
||
|
depends_on:
|
||
|
db:
|
||
|
condition: service_healthy
|
||
|
redis:
|
||
|
condition: service_healthy
|
||
|
|
||
|
worker:
|
||
|
image: ghcr.io/maybe-finance/maybe:latest
|
||
|
command: bundle exec sidekiq
|
||
|
restart: unless-stopped
|
||
|
depends_on:
|
||
|
redis:
|
||
|
condition: service_healthy
|
||
|
environment:
|
||
|
<<: *rails_env
|
||
|
|
||
|
db:
|
||
|
image: postgres:16
|
||
|
restart: unless-stopped
|
||
|
volumes:
|
||
|
- postgres-data:/var/lib/postgresql/data
|
||
|
environment:
|
||
|
<<: *db_env
|
||
|
healthcheck:
|
||
|
test: [ "CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB" ]
|
||
|
interval: 5s
|
||
|
timeout: 5s
|
||
|
retries: 5
|
||
|
|
||
|
redis:
|
||
|
image: redis:latest
|
||
|
ports:
|
||
|
- 6379:6379
|
||
|
restart: unless-stopped
|
||
|
volumes:
|
||
|
- redis-data:/data
|
||
|
healthcheck:
|
||
|
test: [ "CMD", "redis-cli", "ping" ]
|
||
|
interval: 5s
|
||
|
timeout: 5s
|
||
|
retries: 5
|
||
|
|
||
|
volumes:
|
||
|
app-storage:
|
||
|
postgres-data:
|
||
|
redis-data:
|