Skip to content

Commit 7100ad7

Browse files
authored
Merge pull request #97 from fboucher/docs-update-keycloak
Refactors Docker Compose and updates deployment guides
2 parents bf21c9d + a02fdbe commit 7100ad7

9 files changed

Lines changed: 284 additions & 333 deletions

.env-sample

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
1-
# NoteBookmark Docker Compose Environment Variables
2-
# Copy this file to .env and replace all placeholder values with your actual configuration
1+
# Copy to docker-compose/.env and set values.
32

4-
# Keycloak Admin Credentials
5-
KEYCLOAK_ADMIN_PASSWORD=your-secure-admin-password
3+
# Keycloak
4+
KEYCLOAK_USER=admin
5+
KEYCLOAK_PASSWORD=admin
66

7-
# Keycloak Client Configuration
7+
# Keycloak host (local default).
8+
KEYCLOAK_URL=localhost
9+
10+
# Postgres for Keycloak.
11+
POSTGRES_USER=keycloak
12+
POSTGRES_PASSWORD=change-me
13+
14+
# App auth (OIDC)
815
KEYCLOAK_AUTHORITY=http://localhost:8080/realms/notebookmark
916
KEYCLOAK_CLIENT_ID=notebookmark
10-
KEYCLOAK_CLIENT_SECRET=your-keycloak-client-secret
17+
KEYCLOAK_CLIENT_SECRET=replace-with-client-secret
1118

12-
# Azure Storage - Table Storage Connection
13-
NB_STORAGE_OUTPUTS_TABLEENDPOINT=https://your-storage-account.table.core.windows.net/
19+
# Optional
20+
# Keycloak__RequireHttpsMetadata=false
1421

15-
# Azure Storage - Blob Storage Connection
22+
# AI
23+
REKA_API_KEY=replace-with-reka-api-key
24+
25+
# Storage
26+
NB_STORAGE_OUTPUTS_TABLEENDPOINT=https://your-storage-account.table.core.windows.net/
1627
NB_STORAGE_OUTPUTS_BLOBENDPOINT=https://your-storage-account.blob.core.windows.net/
1728

18-
# Notes:
19-
# - Never commit the .env file to version control
20-
# - Keep credentials secure and rotate them regularly
21-
# - For local development, you can use "admin" as KEYCLOAK_ADMIN_PASSWORD
22-
# - For production, use strong passwords and proper Azure Storage connection strings
29+
# Do not commit docker-compose/.env.

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ NoteBookmark is composed of three main sections:
1515

1616
![Slide show of all NoteBookmark Screens](gh/images/NoteBookmark-Tour_hd.gif)
1717

18+
## Run Options
19+
20+
- Development: running the Aspire project is the easiest path and everything is wired automatically.
21+
- Production-style: run with containers and deploy to Azure.
22+
23+
Run locally with Aspire:
24+
25+
```bash
26+
dotnet run --project src/NoteBookmark.AppHost
27+
```
28+
1829
## How to deploy Your own NoteBookmark
1930

2031
### Get the code on your machine
@@ -52,8 +63,9 @@ Voila! Your app is now secure.
5263
## Documentation
5364

5465
For detailed setup guides and configuration information:
66+
- [Keycloak Container Setup](/docs/keycloak-container-setup.md) - Start a local Keycloak instance if you do not already have one
5567
- [Keycloak Authentication Setup](/docs/keycloak-setup.md) - Complete guide for setting up Keycloak authentication
56-
- [Docker Compose Deployment](/docs/docker-compose-deployment.md) - Deploy with Docker Compose (generate from Aspire or use provided files)
68+
- [Docker Compose Deployment](/docs/docker-compose-deployment.md) - Deploy NoteBookmark containers (assumes a healthy Keycloak + configured realm)
5769

5870
## Contributing
5971

docker-compose/build-and-push.ps1

Lines changed: 0 additions & 52 deletions
This file was deleted.

docker-compose/docker-compose.yaml

Lines changed: 0 additions & 66 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: notebookmark-keycloak
2+
3+
services:
4+
keycloak_postgres:
5+
container_name: keycloak-postgres
6+
image: postgres:14.18
7+
restart: unless-stopped
8+
environment:
9+
POSTGRES_DB: keycloak
10+
POSTGRES_USER: ${POSTGRES_USER}
11+
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
12+
volumes:
13+
- postgres-data:/var/lib/postgresql/data
14+
networks:
15+
- notebookmark
16+
17+
keycloak:
18+
container_name: notebookmark-keycloak
19+
image: quay.io/keycloak/keycloak:26.5.4
20+
restart: unless-stopped
21+
command:
22+
- start
23+
environment:
24+
KC_BOOTSTRAP_ADMIN_USERNAME: ${KEYCLOAK_USER}
25+
KC_BOOTSTRAP_ADMIN_PASSWORD: ${KEYCLOAK_PASSWORD}
26+
KC_HOSTNAME: ${KEYCLOAK_URL}
27+
KC_DB: postgres
28+
KC_DB_URL: jdbc:postgresql://keycloak_postgres:5432/keycloak
29+
KC_DB_USERNAME: ${POSTGRES_USER}
30+
KC_DB_PASSWORD: ${POSTGRES_PASSWORD}
31+
KC_PROXY_ADDRESS_FORWARDING: "true"
32+
KC_HTTP_ENABLED: "true"
33+
KC_LOG_LEVEL: info
34+
KC_FEATURES: "token-exchange"
35+
ports:
36+
- "8080:8080"
37+
# Optional production TLS setup: place cert/key under docker-compose/data/certs.
38+
# These values can remain unset for local HTTP usage.
39+
volumes:
40+
- ./data/certs:/etc/x509/https:ro
41+
depends_on:
42+
- keycloak_postgres
43+
networks:
44+
- notebookmark
45+
46+
networks:
47+
notebookmark:
48+
external: true
49+
50+
volumes:
51+
postgres-data:

docker-compose/note-compose.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: notebookmark-app
2+
3+
services:
4+
api:
5+
image: fboucher/notebookmark-api:alpha-latest
6+
container_name: notebookmark-api
7+
restart: unless-stopped
8+
environment:
9+
OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
10+
OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
11+
OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
12+
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
13+
HTTP_PORTS: "8000"
14+
ConnectionStrings__nb-tables: ${NB_STORAGE_OUTPUTS_TABLEENDPOINT}
15+
ConnectionStrings__nb-blobs: ${NB_STORAGE_OUTPUTS_BLOBENDPOINT}
16+
ports:
17+
- "8001:8000"
18+
- "8003:8002"
19+
networks:
20+
- notebookmark
21+
22+
blazor-app:
23+
image: fboucher/notebookmark-blazor:alpha-latest
24+
container_name: notebookmark-blazor
25+
restart: unless-stopped
26+
environment:
27+
OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EXCEPTION_LOG_ATTRIBUTES: "true"
28+
OTEL_DOTNET_EXPERIMENTAL_OTLP_EMIT_EVENT_LOG_ATTRIBUTES: "true"
29+
OTEL_DOTNET_EXPERIMENTAL_OTLP_RETRY: "in_memory"
30+
ASPNETCORE_FORWARDEDHEADERS_ENABLED: "true"
31+
HTTP_PORTS: "8004"
32+
services__api__http__0: "http://api:8000"
33+
services__keycloak__http__0: "http://keycloak:8080"
34+
ConnectionStrings__nb-tables: ${NB_STORAGE_OUTPUTS_TABLEENDPOINT}
35+
ConnectionStrings__nb-blobs: ${NB_STORAGE_OUTPUTS_BLOBENDPOINT}
36+
REKA_API_KEY: ${REKA_API_KEY}
37+
Keycloak__Authority: ${KEYCLOAK_AUTHORITY}
38+
Keycloak__ClientId: ${KEYCLOAK_CLIENT_ID}
39+
Keycloak__ClientSecret: ${KEYCLOAK_CLIENT_SECRET}
40+
volumes:
41+
- ./dataprotection-keys:/root/.aspnet/DataProtection-Keys
42+
ports:
43+
- "8005:8004"
44+
- "8007:8006"
45+
depends_on:
46+
api:
47+
condition: service_started
48+
networks:
49+
- notebookmark
50+
51+
networks:
52+
notebookmark:
53+
external: true

0 commit comments

Comments
 (0)