Skip to content

Commit 834073c

Browse files
committed
Docker/Podman: Add basic runnable Docker Compose example for CrateDB+SSL
1 parent 03154f1 commit 834073c

File tree

5 files changed

+77
-0
lines changed

5 files changed

+77
-0
lines changed

operation/docker/ssl/README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# CrateDB with SSL on Docker
2+
3+
## About
4+
5+
A service composition file (Docker or Podman) for running CrateDB
6+
with SSL enabled.
7+
8+
## Usage
9+
```shell
10+
docker compose up
11+
```
12+
13+
## Rationale
14+
15+
Void of relevant ready-to-run examples.
16+
17+
- https://cratedb.com/docs/guide/install/container/
18+
- https://cratedb.com/docs/guide/install/container/docker.html
19+
- https://cratedb.com/docs/crate/reference/en/latest/admin/ssl.html
20+
21+
## Blueprint
22+
23+
`crate-pdo` includes an example setup using Docker Compose.
24+
25+
- https://github.com/crate/crate-pdo/tree/2.2.2/test/provisioning

operation/docker/ssl/compose.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Purpose:
2+
# Start CrateDB with custom parameters and wait for the service being available,
3+
# even when invoked through `docker compose up --detach`.
4+
5+
services:
6+
7+
cratedb:
8+
image: crate/crate:nightly
9+
command: ["crate", "-Cstats.enabled=true"]
10+
ports:
11+
- 4200:4200
12+
volumes:
13+
- ./crate.yml:/crate/config/crate.yml
14+
- ./keystore:/crate/config/keystore
15+
- ./truststore:/crate/config/truststore
16+
healthcheck:
17+
test: ["CMD", "curl", "--fail", "--insecure", "https://localhost:4200"]
18+
start_period: 3s
19+
interval: 0.5s
20+
retries: 30
21+
timeout: 30s
22+
23+
# https://marcopeg.com/2019/docker-compose-healthcheck/
24+
start_dependencies:
25+
image: dadarek/wait-for-dependencies
26+
depends_on:
27+
cratedb:
28+
condition: service_healthy

operation/docker/ssl/crate.yml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
auth.host_based.enabled: true
2+
auth:
3+
host_based:
4+
config:
5+
1:
6+
user: crate
7+
method: trust
8+
9+
99:
10+
method: password
11+
12+
ssl.http.enabled: true
13+
ssl.psql.enabled: true
14+
ssl.keystore_filepath: /crate/config/keystore
15+
ssl.keystore_password: crate.io
16+
ssl.keystore_key_password: crate.io
17+
ssl.truststore_filepath: /crate/config/truststore
18+
ssl.truststore_password: crate.io
19+
20+
path:
21+
logs: /var/log/crate
22+
data: /data/crate
23+
24+
network.bind_host: 0.0.0.0

operation/docker/ssl/keystore

4.16 KB
Binary file not shown.

operation/docker/ssl/truststore

1.02 KB
Binary file not shown.

0 commit comments

Comments
 (0)