2
0

Docker compose 3.4 (#105)

* Update README.md

* docker-compose: use version:3.4

* readme fix
This commit is contained in:
Julien Bouquillon 2018-07-13 16:28:45 +02:00 committed by Matt Robenolt
parent fa39a377b7
commit 4c00924afe
2 changed files with 48 additions and 41 deletions

View File

@ -16,12 +16,13 @@ There may need to be modifications to the included `docker-compose.yml` file to
1. `mkdir -p data/{sentry,postgres}` - Make our local database and sentry config directories. 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! This directory is bind-mounted with postgres so you don't lose state!
2. `docker-compose run --rm web config generate-secret-key` - Generate a secret key. 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`. Add it to `docker-compose.yml` in `base` as `SENTRY_SECRET_KEY`.
3. `docker-compose run --rm web upgrade` - Build the database. 4. `docker-compose run --rm web upgrade` - Build the database.
Use the interactive prompts to create a user account. Use the interactive prompts to create a user account.
4. `docker-compose up -d` - Lift all services (detached/background mode). 5. `docker-compose up -d` - Lift all services (detached/background mode).
5. Access your instance at `localhost:9000`! 6. Access your instance at `localhost:9000`!
Note that as long as you have your database bind-mounted, you should Note that as long as you have your database bind-mounted, you should
be fine stopping and removing the containers without worry. be fine stopping and removing the containers without worry.
@ -32,6 +33,17 @@ If you'd like to protect your Sentry install with SSL/TLS, there are
fantastic SSL/TLS proxies like [HAProxy](http://www.haproxy.org/) fantastic SSL/TLS proxies like [HAProxy](http://www.haproxy.org/)
and [Nginx](http://nginx.org/). and [Nginx](http://nginx.org/).
## Updating Sentry
Updating Sentry using Compose is relativally simple. Just use the following steps to update. Make sure that you have the latest version set in your Dockerfile. Or use the latest version of this repository.
Use the following steps after updating this repository or your Dockerfile:
```sh
docker-compose build # Build the services again after updating
docker-compose run --rm web upgrade # Run new migrations
docker-compose up -d # Recreate the services
```
## Resources ## Resources
* [Documentation](https://docs.sentry.io/server/installation/docker/) * [Documentation](https://docs.sentry.io/server/installation/docker/)

View File

@ -6,22 +6,30 @@
# See docs.getsentry.com/on-premise/server/ for full # See docs.getsentry.com/on-premise/server/ for full
# instructions # instructions
version: '2' version: '3.4'
services:
base: x-defaults: &defaults
restart: unless-stopped restart: unless-stopped
build: . build: .
depends_on:
- redis
- postgres
- memcached
- smtp
environment: environment:
# Run `docker-compose run web config generate-secret-key` # Run `docker-compose run web config generate-secret-key`
# to get the SENTRY_SECRET_KEY value. # to get the SENTRY_SECRET_KEY value.
# SENTRY_SECRET_KEY: '' SENTRY_SECRET_KEY: ''
SENTRY_MEMCACHED_HOST: memcached SENTRY_MEMCACHED_HOST: memcached
SENTRY_REDIS_HOST: redis SENTRY_REDIS_HOST: redis
SENTRY_POSTGRES_HOST: postgres SENTRY_POSTGRES_HOST: postgres
SENTRY_EMAIL_HOST: smtp SENTRY_EMAIL_HOST: smtp
volumes: volumes:
- ./data/sentry:/var/lib/sentry/files - sentry-data:/var/lib/sentry/files
services:
smtp: smtp:
restart: unless-stopped restart: unless-stopped
image: tianon/exim4 image: tianon/exim4
@ -38,35 +46,22 @@ services:
restart: unless-stopped restart: unless-stopped
image: postgres:9.5 image: postgres:9.5
volumes: volumes:
- ./data/postgres:/var/lib/postgresql/data - sentry-postgres:/var/lib/postgresql/data
web: web:
restart: unless-stopped <<: *defaults
extends: base
links:
- redis
- postgres
- memcached
- smtp
ports: ports:
- '9000:9000' - '9000:9000'
cron: cron:
restart: unless-stopped <<: *defaults
extends: base
command: run cron command: run cron
links:
- redis
- postgres
- memcached
- smtp
worker: worker:
restart: unless-stopped <<: *defaults
extends: base
command: run worker command: run worker
links:
- redis
- postgres volumes:
- memcached sentry-data:
- smtp sentry-postgres: