Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/docker compose example #418

Merged
merged 2 commits into from
Jan 15, 2024
Merged

Feat/docker compose example #418

merged 2 commits into from
Jan 15, 2024

Conversation

fenos
Copy link
Contributor

@fenos fenos commented Jan 12, 2024

What kind of change does this PR introduce?

feature + example

What is the new behavior?

  • Stand-alone docker-compose example
  • Consistent environment variables all backwards compatible
Example: docker-compose.yaml
version: '3'
services:
  storage:
    image: supabase/storage-api:latest
    ports:
      - '5000:5000'
    depends_on:
      tenant_db:
        condition: service_healthy
      multitenant_db:
        condition: service_healthy
      pg_bouncer:
          condition: service_started
      minio_setup:
          condition: service_completed_successfully
    environment:
      # Server
      SERVER_PORT: 5000
      SERVER_REGION: local
      # Auth
      AUTH_JWT_SECRET: f023d3db-39dc-4ac9-87b2-b2be72e9162b
      AUTH_JWT_ALGORITHM: HS256
      AUTH_ENCRYPTION_KEY: encryptionkey
      # Single tenant Mode
      TENANT_ID: bjwdssmqcnupljrqypxz
      ANON_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxMzUzMTk4NSwiZXhwIjoxOTI5MTA3OTg1fQ.mqfi__KnQB4v6PkIjkhzfwWrYyF94MEbSC6LnuvVniE
      SERVICE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaWF0IjoxNjEzNTMxOTg1LCJleHAiOjE5MjkxMDc5ODV9.th84OKK0Iz8QchDyXZRrojmKSEZ-OuitQm_5DvLiSIc
      DATABASE_URL: postgres://postgres:postgres@tenant_db:5432/postgres
      DATABASE_POOL_URL: postgresql://postgres:postgres@pg_bouncer:6432/postgres
      # Migrations
      DB_INSTALL_ROLES: true # set to false if you want to manage roles yourself
      DB_ANON_ROLE: anon
      DB_SERVICE_ROLE: service_role
      DB_AUTHENTICATED_ROLE: authenticated
      DB_SUPER_USER: postgres
      DB_ALLOW_MIGRATION_REFRESH: true
      # Storage
      STORAGE_BACKEND: s3
      STORAGE_S3_BUCKET: supa-storage-bucket  # name of s3 bucket where you want to store objects
      STORAGE_S3_ENDPOINT: http://minio:9000
      STORAGE_S3_FORCE_PATH_STYLE: "true"
      STORAGE_S3_REGION: us-east-1
      AWS_ACCESS_KEY_ID: supa-storage
      AWS_SECRET_ACCESS_KEY: secret1234
      # Upload
      UPLOAD_FILE_SIZE_LIMIT: 524288000
      UPLOAD_FILE_SIZE_LIMIT_STANDARD: 52428800
      UPLOAD_SIGNED_URL_EXPIRATION_TIME: 120
      TUS_URL_PATH: /upload/resumable
      TUS_URL_EXPIRY_MS: 3600000
      # Image Tranformation
      IMAGE_TRANSFORMATION_ENABLED: "true"
      IMGPROXY_URL: http://imgproxy:8080
      IMGPROXY_REQUEST_TIMEOUT: 15

  tenant_db:
    extends:
      service: tenant_db
      file: docker-compose-infra.yml

  pg_bouncer:
    extends:
      service: pg_bouncer
      file: docker-compose-infra.yml

  multitenant_db:
    extends:
      service: multitenant_db
      file: docker-compose-infra.yml

  redis:
    extends:
      service: redis
      file: docker-compose-infra.yml

  minio:
    extends:
      service: minio
      file: docker-compose-infra.yml

  minio_setup:
    extends:
      service: minio_setup
      file: docker-compose-infra.yml
    depends_on:
      - minio

  imgproxy:
    extends:
      service: imgproxy
      file: docker-compose-infra.yml
New Env Old Env
MULTI_TENANT IS_MULTITENANT
SERVER_REGION REGION
SERVER_HOST HOST
SERVER_PORT PORT
SERVER_ADMIN_PORT ADMIN_PORT
SERVER_ADMIN_API_KEYS ADMIN_API_KEYS
REQUEST_X_FORWARDED_HOST_REGEXP X_FORWARDED_HOST_REGEXP
REQUEST_URL_LENGTH_LIMIT URL_LENGTH_LIMIT
REQUEST_TRACE_HEADER REQUEST_ID_HEADER
AUTH_ENCRYPTION_KEY ENCRYPTION_KEY
AUTH_JWT_SECRET PGRST_JWT_SECRET
AUTH_JWT_ALGORITHM PGRST_JWT_ALGORITHM
UPLOAD_FILE_SIZE_LIMIT FILE_SIZE_LIMIT
UPLOAD_FILE_SIZE_LIMIT_STANDARD FILE_SIZE_LIMIT_STANDARD_UPLOAD
UPLOAD_SIGNED_URL_EXPIRATION_TIME SIGNED_UPLOAD_URL_EXPIRATION_TIME
STORAGE_FILE_BACKEND_PATH STORAGE_FILE_PATH
STORAGE_S3_MAX_SOCKETS GLOBAL_S3_MAX_SOCKETS
STORAGE_S3_BUCKET GLOBAL_S3_BUCKET
STORAGE_S3_ENDPOINT GLOBAL_S3_ENDPOINT
STORAGE_S3_FORCE_PATH_STYLE GLOBAL_S3_FORCE_PATH_STYLE
STORAGE_S3_REGION REGION
DATABASE_MULTITENANT_URL MULTITENANT_DATABASE_URL
DEFAULT_METRICS_ENABLED ENABLE_DEFAULT_METRICS
PG_QUEUE_ENABLE ENABLE_QUEUE_EVENTS
IMAGE_TRANSFORMATION_ENABLED ENABLE_IMAGE_TRANSFORMATION

@coveralls
Copy link

coveralls commented Jan 12, 2024

Pull Request Test Coverage Report for Build 7530090552

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 82.983%

Totals Coverage Status
Change from base Build 7487478516: 0.2%
Covered Lines: 7835
Relevant Lines: 9342

💛 - Coveralls

docker-compose-infra.yml Show resolved Hide resolved
@fenos fenos force-pushed the feat/docker-compose-example branch 10 times, most recently from 714a727 to 11d48e1 Compare January 15, 2024 14:08
@fenos fenos force-pushed the feat/docker-compose-example branch from 11d48e1 to 18a183c Compare January 15, 2024 14:15
@fenos fenos merged commit 39f7413 into master Jan 15, 2024
1 check passed
@fenos fenos deleted the feat/docker-compose-example branch January 15, 2024 14:23
Copy link

🎉 This PR is included in version 0.45.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants