-
Notifications
You must be signed in to change notification settings - Fork 0
DT-75: Add Docker support for ClickHouse #76
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,129 @@ | ||
| # devtools | ||
| # Dev-Tools | ||
|
|
||
| Front-end for sqlite DB & betterstack logs | ||
| Front-end for loging and db management | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - Deno | ||
| - Docker | ||
|
|
||
| ### Environment Setup | ||
|
|
||
| Create your environment files: | ||
|
|
||
| ```bash | ||
| # .env.dev | ||
| APP_ENV=dev | ||
| PORT=3021 | ||
| PICTURE_DIR=./.picture | ||
|
|
||
| # Google OAuth | ||
| GOOGLE_CLIENT_ID=your_google_client_id | ||
| CLIENT_SECRET=your_client_secret | ||
| REDIRECT_URI=http://localhost:3021/auth/callback | ||
| SECRET=your_jwt_secret | ||
|
|
||
| # ClickHouse | ||
| CLICKHOUSE_HOST=localhost:8123 | ||
| CLICKHOUSE_USER=dev_user | ||
| CLICKHOUSE_PASSWORD=dev_password | ||
| CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1 | ||
| ``` | ||
|
|
||
| ### ClickHouse Setup | ||
|
|
||
| #### Development | ||
|
|
||
| Start ClickHouse container: | ||
|
|
||
| ```bash | ||
| docker run -d \ | ||
| --env-file .env.dev \ | ||
| --name clickhouse-dev \ | ||
| -p 8123:8123 \ | ||
| -p 9000:9000 \ | ||
| -v ./db/clickhouse-dev:/var/lib/clickhouse \ | ||
| --ulimit nofile=262144:262144 \ | ||
| clickhouse/clickhouse-server:latest | ||
| ``` | ||
|
|
||
| Test connection: | ||
|
|
||
| ```bash | ||
| curl http://localhost:8123/ping | ||
| ``` | ||
|
|
||
| ### Development | ||
|
|
||
| ```bash | ||
| # Start development server | ||
| deno task dev | ||
|
|
||
| # Or with fresh database | ||
| deno task dev:with-seed | ||
| ``` | ||
|
|
||
| This will start: | ||
|
|
||
| - ClickHouse database (port 8123/9000) | ||
| - API server (port 3021) | ||
| - Vite dev server | ||
|
|
||
| ### Production | ||
|
|
||
| ```bash | ||
| # Build | ||
| deno task prod | ||
|
|
||
| # Start production | ||
| deno task start:prod | ||
| ``` | ||
|
|
||
| ### Docker Production | ||
|
|
||
| ```bash | ||
| # Build image | ||
| deno task docker:build | ||
|
|
||
| # Run container | ||
| deno task docker:prod | ||
|
|
||
| # View logs | ||
| deno task docker:logs | ||
| ``` | ||
|
|
||
| ### Available Tasks | ||
|
|
||
| ```bash | ||
| deno task fmt # Format code | ||
| deno task lint # Lint code | ||
| deno task test # Run tests | ||
| deno task check # Type check | ||
| deno task all # Check + lint + test | ||
| ``` | ||
|
|
||
| ### ClickHouse Management | ||
|
|
||
| ```bash | ||
| # Manual commands | ||
| docker stop clickhouse-dev | ||
| docker start clickhouse-dev | ||
| docker rm clickhouse-dev | ||
|
|
||
| # Connect to ClickHouse client | ||
| docker exec -it clickhouse-dev clickhouse-client | ||
|
|
||
| # Clean data directory (if needed) | ||
| sudo rm -rf ./db/clickhouse-dev | ||
| ``` | ||
|
|
||
| ### Project Structure | ||
|
|
||
| ``` | ||
| ├── api/ # Backend API | ||
| ├── web/ # Frontend (Preact) | ||
| ├── tasks/ # Deno tasks | ||
| ├── db/ # Database files | ||
| ``` | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the env file is created, you can pass the env with
--env-file: