Docker Compose
import { Steps, Aside } from ‘@astrojs/starlight/components’;
Quick Start
Section titled “Quick Start”-
Clone and configure
Terminal window git clone https://github.com/your-org/vitasync.gitcd vitasynccp .env.example .envEdit
.env— at minimum set:Terminal window JWT_SECRET=$(openssl rand -base64 32)ENCRYPTION_KEY=$(openssl rand -hex 32)OAUTH_REDIRECT_BASE_URL=http://localhost:3001 -
Start all services
Terminal window docker compose up -dServices started:
Service Port api3001 worker— (background) web3000 postgres5432 redis6379 -
Watch logs
Terminal window docker compose logs -f api worker -
Stop
Terminal window docker compose down
Services
Section titled “Services”The docker-compose.yml defines the following services:
services: api: # Fastify REST API worker: # BullMQ background sync worker web: # Next.js dashboard postgres: # PostgreSQL 16 redis: # Redis 7Database migrations run automatically as an api startup step — no manual action needed.
Development Mode (hot reload)
Section titled “Development Mode (hot reload)”docker compose -f docker-compose.dev.yml upThe dev compose file mounts source directories and runs apps with hot-reload via pnpm dev.
Useful Commands
Section titled “Useful Commands”# Rebuild images after dependency changesdocker compose build
# Run database migrations manuallydocker compose exec api pnpm db:migrate
# Open Drizzle Studio (DB explorer)docker compose exec api pnpm db:studio
# Shell into the API containerdocker compose exec api shPre-release Image Channels
Section titled “Pre-release Image Channels”Every push to any branch triggers a Docker build. Images are tagged according to their channel:
| Branch pattern | Channel | Available tags |
|---|---|---|
main | stable | latest, 1.2.3, 1.2, 1, sha-xxxxxxx |
beta/** | beta | beta, beta-xxxxxxx, sha-xxxxxxx |
feature/**, fix/**, alpha/** | alpha | alpha, alpha-xxxxxxx, sha-xxxxxxx |
Images are published to ghcr.io/your-org/vitasync-{api,worker,web}.
# Pull a specific pre-release build for testingdocker pull ghcr.io/your-org/vitasync-api:beta
# Pin to an exact alpha shadocker pull ghcr.io/your-org/vitasync-api:alpha-abc1234To swap a single service image in your compose file while keeping the rest on latest:
services: api: image: ghcr.io/your-org/vitasync-api:beta # override just the API worker: image: ghcr.io/your-org/vitasync-worker:latest web: image: ghcr.io/your-org/vitasync-web:latest