diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c560055 --- /dev/null +++ b/.env.example @@ -0,0 +1,3 @@ +# Run `docker-compose run web config generate-secret-key` +# to get the SENTRY_SECRET_KEY value. +SENTRY_SECRET_KEY= diff --git a/.gitignore b/.gitignore index 5be26a3..e10a153 100644 --- a/.gitignore +++ b/.gitignore @@ -65,5 +65,11 @@ target/ # pyenv .python-version +# https://docs.docker.com/compose/extends/ +docker-compose.override.yml + +# env config +.env + *.tar data/ diff --git a/README.md b/README.md index bb77eb2..343ad1f 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,16 @@ will get you up and running in no time! There may need to be modifications to the included `docker-compose.yml` file to accommodate your needs or your environment. These instructions are a guideline for what you should generally do. -1. `mkdir -p data/{sentry,postgres}` - Make our local database and sentry config directories. - This directory is bind-mounted with postgres so you don't lose state! -2. `docker-compose build` - Build and tag the Docker services -3. `docker-compose run --rm web config generate-secret-key` - Generate a secret key. - Add it to `docker-compose.yml` in `base` as `SENTRY_SECRET_KEY`. -4. `docker-compose run --rm web upgrade` - Build the database. +1. `docker volume create --name=sentry-data && docker volume create --name=sentry-postgres` - Make our local database and sentry volumes + Docker volumes have to be created manually, as they are declared as external to be more durable. +2. `cp -n .env.example .env` - create env config file +3. `docker-compose build` - Build and tag the Docker services +4. `docker-compose run --rm web config generate-secret-key` - Generate a secret key. + Add it to `.env` as `SENTRY_SECRET_KEY`. +5. `docker-compose run --rm web upgrade` - Build the database. Use the interactive prompts to create a user account. -5. `docker-compose up -d` - Lift all services (detached/background mode). -6. Access your instance at `localhost:9000`! - -Note that as long as you have your database bind-mounted, you should -be fine stopping and removing the containers without worry. +6. `docker-compose up -d` - Lift all services (detached/background mode). +7. Access your instance at `localhost:9000`! ## Securing Sentry with SSL/TLS diff --git a/docker-compose.yml b/docker-compose.yml index 00864a5..2571992 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,11 +16,8 @@ x-defaults: &defaults - postgres - memcached - smtp - + env_file: .env environment: - # Run `docker-compose run web config generate-secret-key` - # to get the SENTRY_SECRET_KEY value. - SENTRY_SECRET_KEY: '' SENTRY_MEMCACHED_HOST: memcached SENTRY_REDIS_HOST: redis SENTRY_POSTGRES_HOST: postgres @@ -64,4 +61,6 @@ services: volumes: sentry-data: + external: true sentry-postgres: + external: true