Skip to content

Instantly share code, notes, and snippets.

@watiko
Forked from yuroyoro/README.md
Last active December 1, 2017 20:48
Show Gist options
  • Save watiko/03e65332c183cc634c3713d2253a825c to your computer and use it in GitHub Desktop.
Save watiko/03e65332c183cc634c3713d2253a825c to your computer and use it in GitHub Desktop.
Sentryをdocker-composeで。
  1. docker run --rm sentry config generate-secret-key で SECRET_KEY を生成する
  2. SECRET_KEY を環境変数にいれる export SENTRY_SECRET_KEY="your generated secret key"
  3. docker-compose up -d でサービスあげる
  4. docker-compose run --rm sentry sentry upgrade で初期設定する
  5. docker-compose restart で再起動
  6. Go http://localhost:9000 and get sentry!
version: "2"
services:
redis:
image: redis
postgres:
image: postgres:9.6
environment:
POSTGRES_USER: sentry
POSTGRES_PASSWORD: secret
volumes:
- 'data:/var/lib/postgresql/data'
nginx:
image: nginx
ports:
- 9000:80
links:
- sentry
volumes:
- './nginx.conf:/etc/nginx/conf.d/default.conf'
sentry:
image: sentry
links:
- redis
- postgres
environment:
SENTRY_SECRET_KEY: "${SENTRY_SECRET_KEY}"
SENTRY_POSTGRES_HOST: postgres
SENTRY_DB_USER: sentry
SENTRY_DB_PASSWORD: secret
SENTRY_REDIS_HOST: redis
SENTRY_SINGLE_ORGANIZATION: 'False'
volumes:
- 'files:/var/lib/sentry/files'
cron:
image: sentry
command: "sentry run cron"
links:
- redis
- postgres
environment:
SENTRY_SECRET_KEY: "${SENTRY_SECRET_KEY}"
SENTRY_POSTGRES_HOST: postgres
SENTRY_DB_USER: sentry
SENTRY_DB_PASSWORD: secret
SENTRY_REDIS_HOST: redis
volumes:
- 'files:/var/lib/sentry/files'
worker:
image: sentry
command: "sentry run worker"
links:
- redis
- postgres
environment:
SENTRY_SECRET_KEY: "${SENTRY_SECRET_KEY}"
SENTRY_POSTGRES_HOST: postgres
SENTRY_DB_USER: sentry
SENTRY_DB_PASSWORD: secret
SENTRY_REDIS_HOST: redis
volumes:
- 'files:/var/lib/sentry/files'
volumes:
data:
driver: 'local'
files:
driver: 'local'
server {
listen 80;
server_name localhost;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_redirect off;
# keepalive + raven.js is a disaster
keepalive_timeout 0;
# use very aggressive timeouts
proxy_read_timeout 5s;
proxy_send_timeout 5s;
send_timeout 5s;
resolver_timeout 5s;
client_body_timeout 5s;
# buffer larger messages
client_max_body_size 5m;
client_body_buffer_size 100k;
location / {
proxy_pass http://sentry:9000;
add_header Strict-Transport-Security "max-age=31536000";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment