infra: migrate deployment to Coolify with Garage S3
- Remove docker-compose files (Coolify manages services individually) - Replace MinIO with Garage (S3-compatible, actively maintained) - Add CI deploy job: build+push :develop image on every green Develop push - Add Coolify webhook trigger for automatic redeployment - Update README, .env.example, and storage references - Rename migrate script to provider-agnostic name Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
108
README.md
108
README.md
@@ -1,6 +1,6 @@
|
||||
# GearBox
|
||||
|
||||
A single-user web app for managing gear collections (bikepacking, sim racing, etc.), tracking weight and price, and planning purchases through research threads.
|
||||
A web app for managing gear collections (bikepacking, sim racing, etc.), tracking weight and price, and planning purchases through research threads.
|
||||
|
||||
## Features
|
||||
|
||||
@@ -10,113 +10,65 @@ A single-user web app for managing gear collections (bikepacking, sim racing, et
|
||||
- Research threads for comparing candidates before buying
|
||||
- Image uploads for items and candidates
|
||||
|
||||
## Quick Start (Docker)
|
||||
## Deployment
|
||||
|
||||
### Docker Compose (recommended)
|
||||
GearBox is deployed via [Coolify](https://coolify.io/) as a Docker image with separate services for dependencies.
|
||||
|
||||
Create a `docker-compose.yml`:
|
||||
**Required services:**
|
||||
- **PostgreSQL 16** — primary database
|
||||
- **Garage** (or any S3-compatible storage) — image uploads
|
||||
- **Logto** — OIDC authentication
|
||||
|
||||
```yaml
|
||||
services:
|
||||
gearbox:
|
||||
image: gitea.jeanlucmakiola.de/makiolaj/gearbox:latest
|
||||
container_name: gearbox
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- DATABASE_PATH=./data/gearbox.db
|
||||
volumes:
|
||||
- gearbox-data:/app/data
|
||||
- gearbox-uploads:/app/uploads
|
||||
healthcheck:
|
||||
test: ["CMD", "bun", "-e", "fetch('http://localhost:3000/api/health').then(r=>r.ok?process.exit(0):process.exit(1)).catch(()=>process.exit(1))"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
start_period: 10s
|
||||
retries: 3
|
||||
restart: unless-stopped
|
||||
**GearBox image:** `gitea.jeanlucmakiola.de/makiolaj/gearbox:latest`
|
||||
|
||||
volumes:
|
||||
gearbox-data:
|
||||
gearbox-uploads:
|
||||
```
|
||||
|
||||
Then run:
|
||||
|
||||
```bash
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
GearBox will be available at `http://localhost:3000`.
|
||||
|
||||
### Docker
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name gearbox \
|
||||
-p 3000:3000 \
|
||||
-e NODE_ENV=production \
|
||||
-e DATABASE_PATH=./data/gearbox.db \
|
||||
-v gearbox-data:/app/data \
|
||||
-v gearbox-uploads:/app/uploads \
|
||||
--restart unless-stopped \
|
||||
gitea.jeanlucmakiola.de/makiolaj/gearbox:latest
|
||||
```
|
||||
|
||||
## Data
|
||||
|
||||
All data is stored in two Docker volumes:
|
||||
|
||||
- **gearbox-data** -- SQLite database
|
||||
- **gearbox-uploads** -- uploaded images
|
||||
|
||||
Back up these volumes to preserve your data.
|
||||
See `.env.example` for required environment variables.
|
||||
|
||||
## Updating
|
||||
|
||||
```bash
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
CI pushes a new Docker image on every release. Coolify auto-deploys when the image tag updates.
|
||||
|
||||
Database migrations run automatically on startup.
|
||||
Database migrations run automatically on startup via `entrypoint.sh`.
|
||||
|
||||
## Tech Stack
|
||||
|
||||
- **Runtime & Package Manager:** [Bun](https://bun.sh)
|
||||
- **Frontend:** React 19, Vite, TanStack Router, TanStack Query, Tailwind CSS v4, Zustand
|
||||
- **Backend:** Hono, Drizzle ORM, SQLite (`bun:sqlite`)
|
||||
- **Backend:** Hono, Drizzle ORM, PostgreSQL
|
||||
- **Storage:** S3-compatible (Garage, Cloudflare R2, AWS S3)
|
||||
- **Auth:** OIDC via Logto
|
||||
|
||||
## Local Development Setup
|
||||
## Local Development
|
||||
|
||||
### Prerequisites
|
||||
|
||||
You must have [Bun](https://bun.sh/) installed on your machine. Docker is not required for local development.
|
||||
- [Bun](https://bun.sh/) installed
|
||||
- PostgreSQL, Logto, and Garage running (via Coolify test instance or locally)
|
||||
|
||||
### Installation
|
||||
### Setup
|
||||
|
||||
1. Install all dependencies:
|
||||
1. Install dependencies:
|
||||
```bash
|
||||
bun install
|
||||
```
|
||||
|
||||
2. Initialize the local SQLite database (`gearbox.db`):
|
||||
2. Copy and configure environment:
|
||||
```bash
|
||||
bun run db:push
|
||||
cp .env.example .env
|
||||
# Edit .env with your service URLs and credentials
|
||||
```
|
||||
|
||||
3. Start the development servers:
|
||||
```bash
|
||||
bun run dev
|
||||
```
|
||||
This single command will start both the Vite frontend server (port `5173`) and the Hono backend server (port `3000`) concurrently.
|
||||
Starts both the Vite frontend (port `5173`) and Hono backend (port `3000`).
|
||||
|
||||
Open [http://localhost:5173](http://localhost:5173) in your browser to view the app.
|
||||
Open [http://localhost:5173](http://localhost:5173) in your browser.
|
||||
|
||||
## Additional Commands
|
||||
## Commands
|
||||
|
||||
- `bun run build` — Build the production assets into `dist/client/`
|
||||
- `bun test` — Run the test suite
|
||||
- `bun run lint` — Check formatting and lint rules using Biome
|
||||
- `bun run db:generate` — Generate Drizzle migrations after making schema changes
|
||||
- `bun run dev` — Start dev servers (frontend + backend)
|
||||
- `bun run build` — Build production assets
|
||||
- `bun test` — Run tests
|
||||
- `bun run lint` — Lint with Biome
|
||||
- `bun run db:generate` — Generate Drizzle migrations after schema changes
|
||||
|
||||
Reference in New Issue
Block a user