Rails monolith with Sidekiq, PostgreSQL, Redis. Deployed via Docker + Kamal.
- Development: Local (Docker Compose)
- Staging: Raspberry Pi (
pi5main.local) - ARM64, manual deploy - Production: VPS (
146.59.44.70) - x86_64, auto-deploy via GitHub Actions
Prerequisites: Docker, Docker Compose
# 1. Clone repo
git clone <repo-url> && cd kw-app
# 2. Build and start services
docker-compose build
docker-compose up -d postgres redis mailcatcher
sleep 5
# 3. Create databases
docker-compose exec -T postgres psql -U dev-user -c "CREATE DATABASE kw_app_development;" postgres
docker-compose exec -T postgres psql -U dev-user -c "CREATE DATABASE kw_app_test;" postgres
# 4. Migrate and seed
docker-compose run --rm -T app bundle exec rake db:migrate db:seed
# 5. Start app
docker-compose up -d
# Visit http://localhost:3002Local services:
- App: http://localhost:3002
- Sidekiq: http://localhost:3002/sidekiq
- MailCatcher: http://localhost:1080
See ansible/README.md for server provisioning.
# Local
docker-compose exec app bundle exec rails console
# Staging (SSH first: ssh rege@pi5main.local)
kamal app exec --reuse -d staging "bundle exec rails console"
# Production (SSH first: ssh ubuntu@146.59.44.70)
kamal app exec --reuse -d production "bundle exec rails console"ssh rege@pi5main.local
cd ~/kw-app && git pull origin develop
kamal deploy -d staging# Push to 'main' branch - GitHub Actions handles the rest
git push origin mainEncrypted credentials in config/credentials/*.yml.enc. Master keys in Bitwarden (never commit).
Edit:
docker-compose exec app bash -c "EDITOR=vim bin/rails credentials:edit --environment development"See docs/RAILS_ENCRYPTED_CREDENTIALS.md
- Docker setup: docs/DOCKER_SETUP.md
- Known issues: docs/KNOWN_ISSUES.md
- AI guidelines: CLAUDE.md
- Zed agents: .agents/README.md
Where to commit:
- Features/fixes:
developbranch (staging) - Production deploy:
mainbranch (triggers CI/CD)
Never commit: Master keys, secrets, or config/credentials/*.key files.