redis的docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
version: "3.3"

services:
sentry_redis:
container_name: sentry_redis
image: redis
volumes:
- /e/wsl/docker/redis/data:/data
ports:
- 6379:6379
networks:
- local

networks:
local:
external:
name: local

postgres的docker-compose.yml文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
version: "3.3"

services:
sentry_postgres:
container_name: sentry_postgres
image: postgres:9.6
privileged: true
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123456
volumes:
- /e/wsl/docker/postgres/data:/var/lib/postgresql/data
ports:
- 5432:5432
networks:
- local

networks:
local:
external:
name: local

sentry的docker-compose文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
version: "3.3"

services:
sentry:
container_name: sentry
image: sentry
environment:
SENTRY_REDIS_HOST: redis
SENTRY_POSTGRES_HOST: postgres
SENTRY_DB_USER: postgres
SENTRY_DB_PASSWORD: 123456
SENTRY_SECRET_KEY: 6mu1#ki^5ec#j3yp&61bbe!*35scz(k))d0c#uz3!!2dx%wztz
ports:
- 9000:9000
networks:
- local
sentry-cron:
container_name: sentry-cron
image: sentry
command: "sentry run cron"
environment:
SENTRY_REDIS_HOST: redis
SENTRY_POSTGRES_HOST: postgres
SENTRY_DB_USER: postgres
SENTRY_DB_PASSWORD: 123456
SENTRY_SECRET_KEY: 6mu1#ki^5ec#j3yp&61bbe!*35scz(k))d0c#uz3!!2dx%wztz
networks:
- local
sentry-worker:
container_name: sentry-worker
image: sentry
command: "sentry run worker"
environment:
SENTRY_REDIS_HOST: redis
SENTRY_POSTGRES_HOST: postgres
SENTRY_DB_USER: postgres
SENTRY_DB_PASSWORD: 123456
SENTRY_SECRET_KEY: 6mu1#ki^5ec#j3yp&61bbe!*35scz(k))d0c#uz3!!2dx%wztz
networks:
- local

networks:
local:
external:
name: local

生成密钥

1
docker run --rm sentry config generate-secret-key

连接Redis、Postgres和Sentry,执行初始化操作

1
2
3
4
5
6
## postgres用户必须是超级用户

docker run -it --rm -e SENTRY_SECRET_KEY='<secret-key>' -e SENTRY_REDIS_HOST='redis' -e SENTRY_POSTGRES_HOST='postgres' -e SENTRY_DB_USER='sentry' -e SENTRY_DB_PASSWORD='secret' --network <network> --link postgres:sentry_postgres --link redis:sentry_redis sentry upgrade


docker run -it --rm -e SENTRY_SECRET_KEY='ccvxndrlk&l@511)#yu2t8y0q2m8&x-gmr4bojd29t&1vu+h8*' -e SENTRY_REDIS_HOST='redis' -e SENTRY_POSTGRES_HOST='postgres' -e SENTRY_DB_USER='postgres' -e SENTRY_DB_PASSWORD='ABC@123abc' --network local --link postgres:postgres --link sentry_redis:redis sentry upgrade

启动sentry

1
docker-compose up -d