Skip to content

Commit ff18693

Browse files
Add diagnostics sidecar to compose
1 parent e082d08 commit ff18693

File tree

3 files changed

+43
-6
lines changed

3 files changed

+43
-6
lines changed

docker/docker-compose.prod.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,26 @@ name: kattbot
22

33
services:
44
kattbot:
5-
image: ghcr.io/selfdocumentingcode/kattbot:$IMAGE_TAG
5+
image: ghcr.io/selfdocumentingcode/kattbot:${IMAGE_TAG}
66
restart: unless-stopped
77
tty: true
88
extra_hosts:
99
- "host.docker.internal=$HOST_GATEWAY_IP"
1010
environment:
1111
Kattbot__BotToken: $BOT_TOKEN
1212
Kattbot__OpenAiApiKey: $OPENAI_API_KEY
13-
Kattbot__ConnectionString: $DB_CONNECTION_STRING
13+
Kattbot__ConnectionString: $DB_CONNECTION_STRING
14+
volumes:
15+
- kattbot-diag-tmp:/tmp
16+
17+
kattbot-diagnostics:
18+
image: ghcr.io/selfdocumentingcode/dotnet-diag-tools:9.0
19+
restart: unless-stopped
20+
tty: true
21+
pid: service:kattbot
22+
volumes:
23+
- kattbot-diag-tmp:/tmp
24+
25+
volumes:
26+
kattbot-diag-tmp:
27+
driver: local

docker/docker-compose.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,21 @@ services:
88
tty: true
99
environment:
1010
- DOTNET_ENVIRONMENT=Development
11-
env_file:
12-
- path: .env.local
13-
required: false
1411
volumes:
15-
- ${APPDATA}/Microsoft/UserSecrets:/home/app/.microsoft/usersecrets:ro
12+
- ${HOME}/.microsoft/usersecrets:/home/app/.microsoft/usersecrets:ro
13+
- kattbot-diag-tmp:/tmp
1614

15+
kattbot-diagnostics:
16+
build:
17+
context: ..
18+
dockerfile: src/Kattbot/diag.Dockerfile
19+
tty: true
20+
pid: service:kattbot
21+
volumes:
22+
- kattbot-diag-tmp:/tmp
23+
profiles:
24+
- diagnostics
25+
1726
kattbot-pgsql:
1827
image: postgres:15.5
1928
ports:
@@ -41,4 +50,7 @@ services:
4150

4251
volumes:
4352
kattbot-pgdata:
53+
driver: local
54+
kattbot-diag-tmp:
55+
driver: local
4456

src/Kattbot/diag.Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:9.0
2+
3+
RUN dotnet tool install -g dotnet-counters && \
4+
dotnet tool install -g dotnet-monitor && \
5+
dotnet tool install -g dotnet-trace && \
6+
dotnet tool install -g dotnet-dump && \
7+
dotnet tool install -g dotnet-stack
8+
9+
ENV PATH="/root/.dotnet/tools:$PATH"
10+
11+
ENTRYPOINT ["tail", "-f", "/dev/null"]

0 commit comments

Comments
 (0)