安装
从 github 上下载安装的 docker-compose.yml 脚本文件 ,我试了几种,使用版本 7.15.2 安装成功,
注意,配置中默认使用最新版本,我测试时会发生各种问题,在配置文件中指定一下版本好了
去掉脚本中的 build 部分
version: '3.7'
services:
app:
depends_on:
- elasticsearch
- redis
image: exceptionless/app:6.1.4
environment:
EX_AppMode: Production
EX_ConnectionStrings__Cache: provider=redis
EX_ConnectionStrings__Elasticsearch: server=http://elasticsearch:9200
# smtp 参数, @ 使用 %40 转义
EX_ConnectionStrings__Email: smtps://xxxxx%40163.com:xxxx@smtp.163.com:465
# 指定 from
EX_SmtpFrom: xxxx@163.com
# 不指定的话,邮件中的地址会指向官网
EX_BaseURL: https://exceptionless.abc.com:7004//#!
EX_ConnectionStrings__MessageBus: provider=redis
#EX_ConnectionStrings__Metrics: provider=statsd;server=statsd;
EX_ConnectionStrings__Queue: provider=redis
EX_ConnectionStrings__Redis: server=redis,abortConnect=false
# 启动 https 应该要指定 https://+
ASPNETCORE_URLS: http://+;https://+
# 启动 https 应该要指定该项
ASPNETCORE_HTTPS_PORT: 5001
# 证书密码
ASPNETCORE_Kestrel__Certificates__Default__Password: "!xxxxx"
# 证书存储位置,默认在卷中
ASPNETCORE_Kestrel__Certificates__Default__Path: "/https/exceptionless.abc.com.pfx"
EX_RunJobsInProcess: 'false'
ports:
- 5000:80
- 5001:443
volumes:
- appdata:/app/storage
# 证书存储在卷中
- ssldata:/https
jobs:
depends_on:
- app
image: exceptionless/job:6.1.4
environment:
EX_AppMode: Production
EX_BaseURL: http://localhost:5000
EX_ConnectionStrings__Cache: provider=redis
EX_ConnectionStrings__Elasticsearch: server=http://elasticsearch:9200
# smtp 参数, @ 使用 %40 转义
EX_ConnectionStrings__Email: smtps://xxxxx%40163.com:xxxx@smtp.163.com:465
# 指定 from
EX_SmtpFrom: xxxx@163.com
# 不指定的话,邮件中的地址会指向官网
EX_BaseURL: https://exceptionless.abc.com:7004//#!
EX_ConnectionStrings__MessageBus: provider=redis
#EX_ConnectionStrings__Metrics: provider=statsd;server=statsd;
EX_ConnectionStrings__Queue: provider=redis
EX_ConnectionStrings__Redis: server=redis,abortConnect=false
EX_ConnectionStrings__Storage: provider=folder;path=/app/storage
volumes:
- appdata:/app/storage
elasticsearch:
image: exceptionless/elasticsearch:7.15.2
environment:
discovery.type: single-node
xpack.security.enabled: 'false'
xpack.security.http.ssl.enabled: 'false'
xpack.ml.enabled: 'false'
# 指定下占用内存,不然可能因为内存不足而停止工作
ES_JAVA_OPTS: -Xms512m -Xmx512m
ports:
- 9200:9200
- 9300:9300
volumes:
- esdata7:/usr/share/elasticsearch/data
# kibana:
# depends_on:
# - elasticsearch
# image: docker.elastic.co/kibana/kibana:7.7.1
# ports:
# - 5601:5601
redis:
image: redis:6.0-alpine
ports:
- 6379:6379
volumes:
esdata7:
driver: local
appdata:
driver: local
ssldata:
driver: local
复制证书
# 在 docker-compose.yml 中指定证书的路径,默认在https 目录下,在卷 ssldata 中
# 证书需要安装到卷 ssldata 中, 安装一个 alpine 用来复制 pfx
docker run -it --rm --mount source=exceptionless_ssldata,target=/https --name tmp alpine
# 开始复制 pfx 证书
docker cp ./xxx.pfx tmp:/https/xxx.pfx
```
## 特别说明
> 可能要在 .wslconfig 中指定下使用内存,不然 elasticsearch 可能启动不了
``` powershell
[wsl2]
memory=4GB
swap=4GB