Skip to content

Instantly share code, notes, and snippets.

@denji
Forked from Cubixmeister/README.md
Last active March 31, 2026 08:25
Show Gist options
  • Select an option

  • Save denji/b801f19d95b7d7910982c22bb1478f96 to your computer and use it in GitHub Desktop.

Select an option

Save denji/b801f19d95b7d7910982c22bb1478f96 to your computer and use it in GitHub Desktop.
Simple Sentry docker-compose.yml
  1. Download docker-compose.yml to dir named sentry
  2. Change SENTRY_SECRET_KEY to random 32 char string
  3. Run docker-compose up -d
  4. Run docker-compose exec sentry sentry upgrade to setup database and create admin user
  5. (Optional) Run docker-compose exec sentry pip install sentry-slack if you want slack plugin, it can be done later
  6. Run docker-compose restart sentry
  7. Sentry is now running on public port 9000

Official Sentry integration/plugin

Sentry integration/plugin

version: '2'
volumes:
pgdb:
services:
redis:
image: redis
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
server {
server_name sentry.example.com;
listen 80;
location / {
proxy_pass http://sentry:9000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
}
}
@anboo

anboo commented Mar 20, 2018

Copy link
Copy Markdown

@zhil +

@ulkoart

ulkoart commented Feb 22, 2019

Copy link
Copy Markdown

thanks!

@ringyear

ringyear commented Jun 3, 2019

Copy link
Copy Markdown

thanks

@uhlhosting

Copy link
Copy Markdown

Does this config allows fully functional mail notifications without mailgun? With self hosted smtp? I got connections timeout with nginx config.

@denji

denji commented Jul 16, 2019

Copy link
Copy Markdown
Author

@lmgeek

lmgeek commented Jan 28, 2020

Copy link
Copy Markdown

How to generate SENTRY_SECRET_KEY? I use the docker-compose and nginx.conf but when ingresed in localhost:9000 see the error message please help for install on docker

@grv231

grv231 commented Jan 28, 2020

Copy link
Copy Markdown

@lmgeek do you have sentry already running in docker (up and running)? If so, try and exec inside the container and use sentry config generate-secret-key to generate a new key. I generally keep it in the config.yml file and create a custom docker image

@lmgeek

lmgeek commented Jan 28, 2020

Copy link
Copy Markdown

the first step is docker-compose up -d? or how run the sentry container for generate a new secret-key, i need run first sentry/onepremise?

@grv231

grv231 commented Jan 28, 2020

Copy link
Copy Markdown

@ImGeek I followed the on-prem approach, documented here. The first three steps are good enough to generate the key (preferably different keys for different environments) and then pass that key as env var when you do the deploy to different environments

@throrin19

Copy link
Copy Markdown

any news about v10 ?

@itJunky

itJunky commented Jul 27, 2020

Copy link
Copy Markdown

I need to configure mail server for send mentions from sentry. Where i can find config.yml? https://stackoverflow.com/questions/50344403/how-to-config-smtp-settings-in-sentry here is a solution without docker. But how i can do it in this docker way?

@Braintelligence

Copy link
Copy Markdown

@itJunky How about you look at the official Docker Hub Image readme? https://hub.docker.com/_/sentry

@bokink2099

Copy link
Copy Markdown

Hello guys, currently I have some issues when I invited new members its success. But when I try to log in using an account the new member can't log in. Did you guys know why?

@yainakrub

yainakrub commented Aug 9, 2021

Copy link
Copy Markdown

relation "sentry_option" does not exist at character 114

how to edit ?

image

@Qetbn

Qetbn commented Nov 15, 2021

Copy link
Copy Markdown

thanks! awesome hints

@alexxxxey

Copy link
Copy Markdown

Thank a lot! I think you can remove sections links:

@mumutu66

Copy link
Copy Markdown

how to use dedicate kafka...

@viotile

viotile commented Dec 7, 2022

Copy link
Copy Markdown

For steps 2:
Generate secret key by following command :
docker-compose run --rm sentry config generate-secret-key

@SeLub

SeLub commented Feb 14, 2023

Copy link
Copy Markdown

How to fix?

ERROR: relation "sentry_option" does not exist at character 114

@ggreeshma07

Copy link
Copy Markdown

how to fix this error:
failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: base name (${BASE_IMAGE}) should not be blank

@thomanhphuc

Copy link
Copy Markdown

How to fix?

ERROR: relation "sentry_option" does not exist at character 114

docker exec -it sentry-sentry-1 sentry upgrade

@AlaaiDwidar

Copy link
Copy Markdown

i want to make sentry https , can anyone help

@Abhis9929

Copy link
Copy Markdown

hey I am getting the error in worker node.

I just deployed the above docker-compose file and changed the secret key and execute upgrade command but getting error in worker node.

Please help me to fix this error as getting from a long time.

worker-node

@des1roer

Copy link
Copy Markdown

on error

docker-sentry-1     |     return self.cursor.execute(sql, clean_bad_params(params))
docker-sentry-1     | ProgrammingError: ProgrammingError('relation "sentry_projectkey" does not exist\nLINE 1: ...te_limit_window", "sentry_projectkey"."data" FROM "sentry_pr...\n                                                             ^\n',)
docker-sentry-1     | SQL: SELECT "sentry_projectkey"."id", "sentry_projectkey"."project_id", "sentry_projectkey"."label", "sentry_projectkey"."public_key", "sentry_projectkey"."secret_key", "sentry_projectkey"."roles", "sentry_projectkey"."status", "sentry_projectkey"."date_added", "sentry_projectkey"."rate_limit_count", "sentry_projectkey"."rate_limit_window", "sentry_projectkey"."data" FROM "sentry_projectkey" WHERE ("sentry_projectkey"."project_id" = %s  AND "sentry_projectkey"."roles" =  "sentry_projectkey"."roles" | 1) LIMIT 1
docker-sentry-1     | 14:36:02 [ERROR] sentry_sdk.errors: Internal error in sentry_sdk

docker exec sentry bash

into container:

sentry upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment