Skip to content

Instantly share code, notes, and snippets.

@andyklimczak
Last active August 21, 2024 19:54
Show Gist options
  • Save andyklimczak/019ce34b186d682c13ac654016610934 to your computer and use it in GitHub Desktop.
Save andyklimczak/019ce34b186d682c13ac654016610934 to your computer and use it in GitHub Desktop.
# 1. run `docker run -rm sentry config generate-secret-key` and copy it to all `SENTRY_SECRET_KEY` values
# 2. run `docker compose up` to start sentry
# 3. run `docker exec sentry sentry upgrade` to migrate db and set up initial user
# 4. visit localhost:9000
volumes:
   pgdb:

services:
  redis:
    image: redis:5 # 5 works, 7 does not. 6 might?

  postgres:
    image: postgres
    environment:
      POSTGRES_USER: sentry
      POSTGRES_PASSWORD: sentry
      POSTGRES_DB: sentry
    volumes:
     - pgdb:/var/lib/postgresql/data

  sentry:
    image: sentry
    links:
     - redis
     - postgres
    ports:
     - 9000:9000
    environment:
      SENTRY_SECRET_KEY: '!!secret!!'
      SENTRY_POSTGRES_HOST: postgres
      SENTRY_DB_USER: sentry
      SENTRY_DB_PASSWORD: sentry
      SENTRY_REDIS_HOST: redis

  cron:
    image: sentry
    links:
     - redis
     - postgres
    command: "sentry run cron"
    environment:
      SENTRY_SECRET_KEY: '!!secret!!'
      SENTRY_POSTGRES_HOST: postgres
      SENTRY_DB_USER: sentry
      SENTRY_DB_PASSWORD: sentry
      SENTRY_REDIS_HOST: redis

  worker:
    image: sentry
    links:
     - redis
     - postgres
    command: "sentry run worker"
    environment:
      SENTRY_SECRET_KEY: '!!secret!!'
      SENTRY_POSTGRES_HOST: postgres
      SENTRY_DB_USER: sentry
      SENTRY_DB_PASSWORD: sentry
      SENTRY_REDIS_HOST: redis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment