Skip to content

Docker/Podman: Add basic runnable Docker Compose example for CrateDB+SSL #825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions operation/docker/ssl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# CrateDB with SSL on Docker

## About

A service composition file (Docker or Podman) for running CrateDB
with SSL enabled.

## Usage
```shell
docker compose up
```

## Rationale

Void of relevant ready-to-run examples.

- https://cratedb.com/docs/guide/install/container/
- https://cratedb.com/docs/guide/install/container/docker.html
- https://cratedb.com/docs/crate/reference/en/latest/admin/ssl.html

## Blueprint

`crate-pdo` includes an example setup using Docker Compose.

- https://github.com/crate/crate-pdo/tree/2.2.2/test/provisioning
28 changes: 28 additions & 0 deletions operation/docker/ssl/compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Purpose:
# Start CrateDB with custom parameters and wait for the service being available,
# even when invoked through `docker compose up --detach`.

services:

cratedb:
image: crate/crate:nightly
command: ["crate", "-Cstats.enabled=true"]
ports:
- 4200:4200
volumes:
- ./crate.yml:/crate/config/crate.yml
- ./keystore:/crate/config/keystore
- ./truststore:/crate/config/truststore
healthcheck:
test: ["CMD", "curl", "--fail", "--insecure", "https://localhost:4200"]
start_period: 3s
interval: 0.5s
retries: 30
timeout: 30s

# https://marcopeg.com/2019/docker-compose-healthcheck/
start_dependencies:
image: dadarek/wait-for-dependencies
depends_on:
cratedb:
condition: service_healthy
24 changes: 24 additions & 0 deletions operation/docker/ssl/crate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
auth.host_based.enabled: true
auth:
host_based:
config:
1:
user: crate
method: trust

99:
method: password

ssl.http.enabled: true
ssl.psql.enabled: true
ssl.keystore_filepath: /crate/config/keystore
ssl.keystore_password: crate.io
ssl.keystore_key_password: crate.io
ssl.truststore_filepath: /crate/config/truststore
ssl.truststore_password: crate.io

path:
logs: /var/log/crate
data: /data/crate

network.bind_host: 0.0.0.0
Binary file added operation/docker/ssl/keystore
Binary file not shown.
Binary file added operation/docker/ssl/truststore
Binary file not shown.