|
| 1 | +captainVersion: 4 |
| 2 | +services: |
| 3 | + $$cap_appname: |
| 4 | + image: clickhouse/clickhouse-server:$$cap_clickhouse_version |
| 5 | + volumes: |
| 6 | + - $$cap_appname-data:/var/lib/clickhouse |
| 7 | + restart: always |
| 8 | + environment: |
| 9 | + CLICKHOUSE_DB: $$cap_clickhouse_db |
| 10 | + CLICKHOUSE_USER: $$cap_clickhouse_user |
| 11 | + CLICKHOUSE_PASSWORD: $$cap_clickhouse_password |
| 12 | + CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: $$cap_clickhouse_access_management |
| 13 | + caproverExtra: |
| 14 | + notExposeAsWebApp: 'true' |
| 15 | + |
| 16 | +caproverOneClickApp: |
| 17 | + variables: |
| 18 | + - id: $$cap_clickhouse_version |
| 19 | + label: ClickHouse Version |
| 20 | + defaultValue: '24.11-alpine' |
| 21 | + description: Check out their Docker page for the valid tags https://hub.docker.com/r/clickhouse/clickhouse-server/tags |
| 22 | + validRegex: /^([^\s^\/])+$/ |
| 23 | + |
| 24 | + - id: $$cap_clickhouse_db |
| 25 | + label: Default Database |
| 26 | + defaultValue: default |
| 27 | + description: Initial database to create (optional, leave as 'default' if unsure) |
| 28 | + validRegex: /.{1,}/ |
| 29 | + |
| 30 | + - id: $$cap_clickhouse_user |
| 31 | + label: Username |
| 32 | + defaultValue: clickhouse |
| 33 | + description: Username for ClickHouse access (leave empty to use default user) |
| 34 | + validRegex: /.{0,}/ |
| 35 | + |
| 36 | + - id: $$cap_clickhouse_password |
| 37 | + label: Password |
| 38 | + defaultValue: $$cap_gen_random_hex(16) |
| 39 | + description: Password for the user (auto-generated by default) |
| 40 | + validRegex: /.{1,}/ |
| 41 | + |
| 42 | + - id: $$cap_clickhouse_access_management |
| 43 | + label: Enable SQL-driven Access Control |
| 44 | + defaultValue: '1' |
| 45 | + description: Set to 1 to enable SQL-driven access control and account management (recommended) |
| 46 | + validRegex: /^(0|1)$/ |
| 47 | + |
| 48 | + instructions: |
| 49 | + start: >- |
| 50 | + ClickHouse is a fast open-source column-oriented database management system |
| 51 | + that allows generating analytical data reports in real-time using SQL queries. |
| 52 | +
|
| 53 | +
|
| 54 | + This template will deploy ClickHouse with persistent storage and optional |
| 55 | + authentication configuration. |
| 56 | +
|
| 57 | + end: >- |
| 58 | + ClickHouse has been successfully deployed! |
| 59 | +
|
| 60 | +
|
| 61 | + **Connection Details:** |
| 62 | +
|
| 63 | + - HTTP Interface: srv-captain--$$cap_appname:8123 |
| 64 | +
|
| 65 | + - Native Protocol: srv-captain--$$cap_appname:9000 |
| 66 | +
|
| 67 | + - Database: $$cap_clickhouse_db |
| 68 | +
|
| 69 | + - User: $$cap_clickhouse_user |
| 70 | +
|
| 71 | + - Password: [as configured] |
| 72 | +
|
| 73 | +
|
| 74 | + **Usage Examples:** |
| 75 | +
|
| 76 | +
|
| 77 | + Connect from another app using HTTP: |
| 78 | +
|
| 79 | + ``` |
| 80 | + http://$$cap_clickhouse_user:$$cap_clickhouse_password@srv-captain--$$cap_appname:8123/$$cap_clickhouse_db |
| 81 | + ``` |
| 82 | +
|
| 83 | +
|
| 84 | + Connect using clickhouse-client: |
| 85 | +
|
| 86 | + ``` |
| 87 | + clickhouse-client --host srv-captain--$$cap_appname --user $$cap_clickhouse_user --password $$cap_clickhouse_password |
| 88 | + ``` |
| 89 | +
|
| 90 | +
|
| 91 | + **Important Notes:** |
| 92 | +
|
| 93 | + - ClickHouse is NOT exposed to the internet by default (internal use only) |
| 94 | +
|
| 95 | + - Data is persisted in a Docker volume for durability |
| 96 | +
|
| 97 | + - For production use, consider setting up custom config files and users.xml |
| 98 | +
|
| 99 | + - Default ports: 8123 (HTTP), 9000 (Native), 9009 (Interserver) |
| 100 | +
|
| 101 | + displayName: ClickHouse |
| 102 | + isOfficial: true |
| 103 | + description: Fast open-source column-oriented database management system for real-time analytics |
| 104 | + documentation: Official docs at https://clickhouse.com/docs and Docker Hub at https://hub.docker.com/r/clickhouse/clickhouse-server |
0 commit comments