From 72b0e482565c639a8703484a7a388128b3d0e84b Mon Sep 17 00:00:00 2001 From: Matt Robenolt Date: Fri, 19 Feb 2016 15:59:04 -0800 Subject: [PATCH] Update sentry docs Fixes getsentry/docker-sentry#42 --- sentry/content.md | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/sentry/content.md b/sentry/content.md index 3bab5bbbe..5b9d670e1 100644 --- a/sentry/content.md +++ b/sentry/content.md @@ -16,31 +16,37 @@ Sentry is a realtime event logging and aggregation platform. It specializes in m $ docker run -d --name sentry-redis redis ``` -2. Start a Postgres container: +2. Start a Postgres container ```console $ docker run -d --name sentry-postgres -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=sentry postgres ``` -3. If this is a new database, you'll need to run `upgrade` +3. Generate a new secret key to be shared by all `%%REPO%%` containers. This value will then be used as the `SENTRY_SECRET_KEY` environment variable. + + ```console + $ docker run --rm sentry generate-secret-key + ``` + +4. If this is a new database, you'll need to run `upgrade` ```console - $ docker run -it --rm --link sentry-postgres:postgres --link sentry-redis:redis sentry upgrade + $ docker run -it --rm -e SENTRY_SECRET_KEY --link sentry-postgres:postgres --link sentry-redis:redis sentry upgrade ``` **Note: the `-it` is important as the initial upgrade will prompt to create an initial user and will fail without it** -4. Now start up Sentry server +5. Now start up Sentry server ```console - $ docker run -d --name my-sentry --link sentry-redis:redis --link sentry-postgres:postgres sentry + $ docker run -d --name my-sentry -e SENTRY_SECRET_KEY --link sentry-redis:redis --link sentry-postgres:postgres sentry ``` -5. The default config needs a celery beat and celery workers, start as many workers as you need (each with a unique name) +6. The default config needs a celery beat and celery workers, start as many workers as you need (each with a unique name) ```console - $ docker run -d --name sentry-celery-beat --link sentry-postgres:postgres --link sentry-redis:redis sentry celery beat - $ docker run -d --name sentry-celery1 --link sentry-postgres:postgres --link sentry-redis:redis sentry celery worker + $ docker run -d --name sentry-celery-beat -e SENTRY_SECRET_KEY --link sentry-postgres:postgres --link sentry-redis:redis sentry celery beat + $ docker run -d --name sentry-celery1 -e SENTRY_SECRET_KEY --link sentry-postgres:postgres --link sentry-redis:redis sentry celery worker ``` ### Port mapping @@ -52,7 +58,7 @@ If you'd like to be able to access the instance from the host without the contai If you did not create a superuser during `upgrade`, use the following to create one: ```console -$ docker run -it --rm --link sentry-redis:redis --link sentry-postgres:postgres sentry createuser +$ docker run -it --rm -e SENTRY_SECRET_KEY --link sentry-redis:redis --link sentry-postgres:postgres sentry createuser ``` ## Environment variables @@ -64,7 +70,7 @@ When you start the `%%REPO%%` image, you can adjust the configuration of the Sen A secret key used for cryptographic functions within Sentry. This key should be unique and consistent across all running instances. You can generate a new secret key doing something like: ```console -$ docker run --rm -it debian:jessie cat /proc/sys/kernel/random/uuid +$ docker run --rm sentry generate-secret-key ``` ### `SENTRY_POSTGRES_HOST`, `SENTRY_POSTGRES_PORT`, `SENTRY_DB_NAME`, `SENTRY_DB_USER`, `SENTRY_DB_PASSWORD`