feat: add Rocket.Chat Docker deployment with user provisioning (#147)#152
Open
t0kubetsu wants to merge 3 commits into
Open
feat: add Rocket.Chat Docker deployment with user provisioning (#147)#152t0kubetsu wants to merge 3 commits into
t0kubetsu wants to merge 3 commits into
Conversation
- Fix depends_on: rocketchat now waits for mongo-init-replica to complete (race condition) - Fix replica set init: wait for PRIMARY election before exiting init container - Fix token leak: tokens written to file only, not stdout/docker logs - Fix make tokens: use docker run against named volume (docker exec fails on stopped container) - Fix yq: explicitly install mikefarah/yq v4.44.1 - Fix make clean: scope to project only - Improve MongoDB healthcheck to verify replica set status
Author
Code review — fixes appliedFix commit: Critical fixes applied
Open items (non-blocking for lab)
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #147.
Changes
Dockerfile— Two-stage build:node:20-alpinebuilder (installsyq/jq, copies provisioning scripts) →rocketchat/rocket.chat:latestruntimecompose.yml— Four services:mongodb(replica set),mongo-init-replica(one-shot rs.initiate),rocketchat,provisioner; debug anchor included but commented outprovisioning/users.yml— Declarative user list (admins + regular users); passwords clearly marked for change before deployprovisioning/init.sh— POSIX sh provisioner: health-wait loop, idempotency stamp, admin login, user creation viaPOST /api/v1/users.create, PAT generation viaPOST /api/v1/users.generatePersonalAccessToken(user logs in as themselves), output to/tokens/tokens.txt.env.example— Template forRC_BASE_URL,RC_ADMIN_USER/PASS/EMAIL,HTTP_PORTMakefile— Follows repo pattern (SERVICE=rocketchat, PROVISIONER=rocketchat-provisioner); addstokenstarget to print generated PATs.dockerignore— Excludes.env,*.key,*.pem,README.mdfrom build contextREADME.md— Prerequisites, Quick Start, Build & Push, Declaring Users, Token Retrieval, API Usage Examples, Env Vars table, Troubleshooting (MongoDB replica set + provisioner auth errors)Design Notes
node:20-alpinematches the official Rocket.Chat Dockerfile base; runtime isrocketchat/rocket.chat:latest(Alpine/Node)ADMIN_USERNAME/ADMIN_PASS/ADMIN_EMAILenv vars trigger Rocket.Chat's built-in first-run admin creation — no setup wizard interaction needed (OVERWRITE_SETTING_Show_Setup_Wizard: completed)v1API surface/tokens/.provisionedstamp prevents double-provisioning on container restartTesting
make build-upstarts all four services cleanlydocker logs rocketchat-mongo-initshows replica set init successhttp://localhost:3000make tokensprintsusername:tokenlines for all declared usersRelated Issues