# Object Storage configuration for Ghost development environment # Use with: docker compose -f compose.dev.yaml -f compose.dev.storage.yaml up # # This file adds VersityGW (S3-compatible storage) and configures ghost-dev to use it. # Without this file, Ghost uses local filesystem storage (the default). services: versitygw-setup: image: public.ecr.aws/aws-cli/aws-cli:2.36.40@sha256:b6aeb95d19d7f5a8cae4eb814cb16739b6b2a4f2f46f427ada6a8c9a20d9881d container_name: ghost-dev-versitygw-setup entrypoint: ['/bin/sh', '-c'] command: - | set -eu aws --endpoint-url http://versitygw:9000 s3api head-bucket --bucket ghost-dev >/dev/null 2>&1 || aws --endpoint-url http://versitygw:9000 s3api create-bucket --bucket ghost-dev aws --endpoint-url http://versitygw:9000 s3api put-bucket-ownership-controls --bucket ghost-dev --ownership-controls 'Rules=[{ObjectOwnership=ObjectWriter}]' aws --endpoint-url http://versitygw:9000 s3api put-bucket-acl --bucket ghost-dev --acl public-read aws --endpoint-url http://versitygw:9000 s3api head-bucket --bucket ghost-dev-redirects >/dev/null 2>&1 || aws --endpoint-url http://versitygw:9000 s3api create-bucket --bucket ghost-dev-redirects environment: - AWS_ACCESS_KEY_ID=s3-user - AWS_SECRET_ACCESS_KEY=s3-pass - AWS_DEFAULT_REGION=us-east-1 depends_on: versitygw: condition: service_healthy restart: 'no' versitygw: image: ghcr.io/versity/versitygw:v1.7.0@sha256:c4cbd9d9cb8dedbb055ac788dbd02635651b9b1cebac95b095b3217231aa87ad container_name: ghost-dev-versitygw ports: - '127.0.0.1:9000:9000' # S3 API - '127.0.0.1:9001:9001' # WebUI - '127.0.0.1:9002:9002' # Admin API used by the WebUI environment: - ROOT_ACCESS_KEY=s3-user - ROOT_SECRET_KEY=s3-pass - VGW_PORT=:9000 - VGW_WEBUI_PORT=:9001 - VGW_WEBUI_GATEWAYS=http://localhost:9000 - VGW_ADMIN_PORT=:9002 - VGW_WEBUI_ADMIN_GATEWAYS=http://localhost:9002 - VGW_IAM_DIR=/iam - VGW_BACKEND=posix - VGW_BACKEND_ARGS=/data volumes: - versitygw-data:/data - versitygw-iam:/iam healthcheck: test: ['CMD', 'nc', '-z', '127.0.0.1', '9000'] interval: 1s retries: 120 ghost-dev: environment: # Object Storage - S3Storage adapter with VersityGW backend storage__media__adapter: S3Storage storage__media__staticFileURLPrefix: content/media storage__files__adapter: S3Storage storage__files__staticFileURLPrefix: content/files storage__S3Storage__bucket: ghost-dev storage__S3Storage__region: us-east-1 storage__S3Storage__tenantPrefix: ab/ab1234567890abcdef1234567890abcd storage__S3Storage__forcePathStyle: 'true' storage__S3Storage__cdnUrl: http://127.0.0.1:9000/ghost-dev storage__S3Storage__staticFileURLPrefix: content/images storage__S3Storage__endpoint: http://versitygw:9000 storage__S3Storage__accessKeyId: s3-user storage__S3Storage__secretAccessKey: s3-pass storage__S3Storage__multipartUploadThresholdBytes: 10485760 storage__S3Storage__multipartChunkSizeBytes: 10485760 urls__media: http://127.0.0.1:9000/ghost-dev/ab/ab1234567890abcdef1234567890abcd urls__files: http://127.0.0.1:9000/ghost-dev/ab/ab1234567890abcdef1234567890abcd depends_on: versitygw: condition: service_healthy versitygw-setup: condition: service_completed_successfully volumes: versitygw-data: versitygw-iam: