Files
shorebird-server/docker-compose.yml
T
Tony 3bb4ab494e feat: implement database and storage abstractions
- Added `internal/db/store.go` to define the Store interface for database operations, including user, organization, app, channel, release, patch, and artifact management.
- Introduced `internal/models/models.go` changes to reflect updated organization and artifact response structures.
- Created `internal/storage/factory.go`, `local.go`, and `s3.go` to implement storage backends for local filesystem and S3-compatible services.
- Removed deprecated `internal/storage/storage.go` and refactored storage interface into `internal/storage/store.go`.
- Updated frontend JavaScript in `web/js/app.js` to display server health information, including storage and database backend details.
2026-06-12 08:45:01 +08:00

81 lines
2.0 KiB
YAML

# Docker Compose file for optional PostgreSQL + MinIO backends.
# The server runs without Docker by default (SQLite + local filesystem).
# To use the full stack: docker compose --profile full up -d
#
# Then set:
# DB_DRIVER=postgres
# DATABASE_URL=postgres://shorebird:shorebird@localhost:5432/shorebird?sslmode=disable
# STORAGE_DRIVER=s3
# STORAGE_S3_ENDPOINT=localhost:9000
# STORAGE_S3_ACCESS_KEY=minioadmin
# STORAGE_S3_SECRET_KEY=minioadmin
# STORAGE_S3_USE_SSL=false
version: "3.9"
services:
postgres:
image: postgres:16-alpine
profiles: ["full"]
environment:
POSTGRES_USER: shorebird
POSTGRES_PASSWORD: shorebird
POSTGRES_DB: shorebird
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U shorebird"]
interval: 3s
timeout: 3s
retries: 10
minio:
image: minio/minio:latest
profiles: ["full"]
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
- "9001:9001"
volumes:
- miniodata:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 5s
retries: 5
minio-init:
image: minio/mc:latest
profiles: ["full"]
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 minioadmin minioadmin;
mc mb --ignore-existing local/shorebird-releases;
mc mb --ignore-existing local/shorebird-patches;
mc anonymous set public local/shorebird-patches;
echo 'MinIO buckets created';
"
redis:
image: redis:7-alpine
profiles: ["full"]
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 3s
timeout: 3s
retries: 10
volumes:
pgdata:
miniodata: