Skip to content

feat: update postgres image and add local Redis services#314

Merged
taqh merged 1 commit intousemarble:mainfrom
Hashversion:feature/postgres-redis-local
Mar 3, 2026
Merged

feat: update postgres image and add local Redis services#314
taqh merged 1 commit intousemarble:mainfrom
Hashversion:feature/postgres-redis-local

Conversation

@Hashversion
Copy link
Contributor

@Hashversion Hashversion commented Mar 3, 2026

Description

This PR improves the local development stack by:

  • Switching from deprecated bitnami/postgresql:15 to the official postgres:15 image
  • Adding redis and serverless-redis-http services to docker-compose
  • Setting local REDIS_URL and REDIS_TOKEN defaults in API and CMS environment examples
  • Documenting the local Redis setup in CONTRIBUTING.md

Motivation and Context

Previously, local development required setting up Upstash Redis manually before the application could run. This added extra steps and slowed down development iterations.

To improve the workflow, Redis is now included directly in docker-compose for local environments. This allows developers to start all required services with a single command, resulting in faster setup, fewer external dependencies during development, and more consistent local environments.

How to Test

Screenshots (if applicable)

N/A

Video Demo (if applicable)

N/A

Types of Changes

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that alters existing functionality)
  • 🎨 UI/UX Improvements
  • ⚡ Performance Enhancement
  • 📖 Documentation (updates to README, docs, or comments)

Summary by CodeRabbit

Release Notes

  • Documentation

    • Expanded Redis setup guidance in contribution documentation with two configuration options and detailed setup instructions.
  • Chores

    • Updated development environment example files with default Redis configuration values.
    • Updated Docker Compose configuration to include local Redis service with HTTP API support.

- update bitnami/postgresql:15 to official postgres:15 image
- add redis + serverless-redis-http services to docker-compose
- set local REDIS_URL/REDIS_TOKEN defaults in api and cms env examples
- document Redis local setup in CONTRIBUTING.md
@vercel
Copy link

vercel bot commented Mar 3, 2026

@Hashversion is attempting to deploy a commit to the Marble Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link

CLAassistant commented Mar 3, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

Walkthrough

The PR establishes local Redis development infrastructure by updating documentation with two setup options (Upstash cloud or Docker), adding Redis configuration defaults to example environment files, and introducing Redis and serverless-redis-http services to the Docker Compose configuration for local development.

Changes

Cohort / File(s) Summary
Documentation & Setup Guidance
.github/CONTRIBUTING.md
Expanded Redis setup section from single heading to two detailed options: Upstash Redis provisioning and Docker-based local Redis with corresponding environment configuration.
Environment Configuration Examples
apps/api/.dev.vars.example, apps/cms/.env.example
Added Redis configuration defaults: REDIS_URL set to http://localhost:8079 and REDIS_TOKEN set to justusemarble across both app configurations.
Docker Infrastructure
docker-compose.yml
Added redis service and serverless-redis-http service for local development; changed database image from bitnami/postgresql:15 to postgres:15 with proper networking and port mappings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • mezotv

Poem

🐰 Oh, what a hop, what a bound of delight,
Redis now blooms in the local night,
Upstash or Docker, the choice is yours true,
Environment files sing in harmony new! 🎵✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main changes: updating the PostgreSQL image and adding local Redis services to docker-compose.
Description check ✅ Passed The description covers the main sections: description of changes, motivation/context, and types of changes. However, the 'How to Test' section is empty.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/CONTRIBUTING.md (1)

231-233: Normalize heading depth for the Redis subsection.

This section is nested with other setup subsections; using ### here keeps the document hierarchy consistent.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/CONTRIBUTING.md around lines 231 - 233, Change the Redis subsection
heading "Set up Redis" from a level-2 header to a level-3 header to match
surrounding setup subsections; update the heading text "Set up Redis" (and
ensure subsequent sub-headings like "Option 1: Use Upstash Redis" remain at the
correct relative depth) so the document hierarchy is consistent.
docker-compose.yml (1)

27-36: Add an explicit startup dependency for the HTTP bridge on Redis readiness.

serverless-redis-http can come up before Redis is actually ready, which may cause transient failures during local boot. Currently, Redis has no healthcheck and serverless-redis-http lacks a depends_on condition to wait for Redis to be healthy.

Proposed fix
   redis:
     image: redis
     restart: always
     ports:
       - "6379:6379"
+    healthcheck:
+      test: ["CMD", "redis-cli", "ping"]
+      interval: 10s
+      timeout: 5s
+      retries: 10

   serverless-redis-http:
     ports:
       - "8079:80"
     image: hiett/serverless-redis-http:latest
     restart: always
+    depends_on:
+      redis:
+        condition: service_healthy
     environment:
       SRH_MODE: env
       SRH_TOKEN: justusemarble
       SRH_CONNECTION_STRING: "redis://redis:6379" # Using `redis` hostname since they're in the same Docker network.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docker-compose.yml` around lines 27 - 36, Add a Redis healthcheck and make
the serverless-redis-http service wait for it: add a healthcheck block to the
redis service (so the container exposes a healthy/unhealthy status) and add a
depends_on entry with condition: service_healthy to the serverless-redis-http
service so it will not start until redis is reported healthy; reference the
service names "redis" and "serverless-redis-http" when updating the
docker-compose.yml and ensure SRH_CONNECTION_STRING stays pointing to
redis://redis:6379.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/CONTRIBUTING.md:
- Around line 273-280: Add a short, explicit "local-only" warning right after
the block that lists the default Redis values, stating that REDIS_URL and
REDIS_TOKEN (as shown in apps/api/.dev.vars and apps/cms/.env) and the
SRH_TOKEN/ports in docker-compose.yml are for local development only and must
not be used in staging/production; reference the specific defaults
(`REDIS_URL=http://localhost:8079`, `REDIS_TOKEN=justusemarble`,
`SRH_TOKEN=justusemarble`, ports 8079 and 6379) and suggest replacing them with
secure credentials or environment-specific values before deploying.

In `@apps/cms/.env.example`:
- Around line 51-52: The .env.example has Redis keys in the wrong order for
dotenv-linter; move the REDIS_TOKEN entry so it appears before REDIS_URL (i.e.,
swap the two lines) to satisfy the linter—update the REDIS_TOKEN and REDIS_URL
entries in apps/cms/.env.example accordingly.

---

Nitpick comments:
In @.github/CONTRIBUTING.md:
- Around line 231-233: Change the Redis subsection heading "Set up Redis" from a
level-2 header to a level-3 header to match surrounding setup subsections;
update the heading text "Set up Redis" (and ensure subsequent sub-headings like
"Option 1: Use Upstash Redis" remain at the correct relative depth) so the
document hierarchy is consistent.

In `@docker-compose.yml`:
- Around line 27-36: Add a Redis healthcheck and make the serverless-redis-http
service wait for it: add a healthcheck block to the redis service (so the
container exposes a healthy/unhealthy status) and add a depends_on entry with
condition: service_healthy to the serverless-redis-http service so it will not
start until redis is reported healthy; reference the service names "redis" and
"serverless-redis-http" when updating the docker-compose.yml and ensure
SRH_CONNECTION_STRING stays pointing to redis://redis:6379.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 85c3722 and 65b240f.

📒 Files selected for processing (4)
  • .github/CONTRIBUTING.md
  • apps/api/.dev.vars.example
  • apps/cms/.env.example
  • docker-compose.yml

Comment on lines +273 to +280
Set these in your env files:
- `apps/api/.dev.vars``REDIS_URL=http://localhost:8079` and `REDIS_TOKEN=justusemarble`
- `apps/cms/.env``REDIS_URL=http://localhost:8079` and `REDIS_TOKEN=justusemarble`
These values match the local defaults in:
- `apps/api/.dev.vars.example`
- `apps/cms/.env.example`
- `docker-compose.yml` (`SRH_TOKEN=justusemarble`, `8079:80`, `6379:6379`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Add a clear “local-only” warning for the default Redis token/URL values.

The defaults are convenient, but a brief warning here would reduce accidental reuse outside local dev.

🔧 Suggested doc addition
 Set these in your env files:
 - `apps/api/.dev.vars` → `REDIS_URL=http://localhost:8079` and `REDIS_TOKEN=justusemarble`
 - `apps/cms/.env` → `REDIS_URL=http://localhost:8079` and `REDIS_TOKEN=justusemarble`
+
+Note: These Redis values are for local development only. Do not use them in shared/staging/production environments.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Set these in your env files:
- `apps/api/.dev.vars``REDIS_URL=http://localhost:8079` and `REDIS_TOKEN=justusemarble`
- `apps/cms/.env``REDIS_URL=http://localhost:8079` and `REDIS_TOKEN=justusemarble`
These values match the local defaults in:
- `apps/api/.dev.vars.example`
- `apps/cms/.env.example`
- `docker-compose.yml` (`SRH_TOKEN=justusemarble`, `8079:80`, `6379:6379`)
Set these in your env files:
- `apps/api/.dev.vars``REDIS_URL=http://localhost:8079` and `REDIS_TOKEN=justusemarble`
- `apps/cms/.env``REDIS_URL=http://localhost:8079` and `REDIS_TOKEN=justusemarble`
Note: These Redis values are for local development only. Do not use them in shared/staging/production environments.
These values match the local defaults in:
- `apps/api/.dev.vars.example`
- `apps/cms/.env.example`
- `docker-compose.yml` (`SRH_TOKEN=justusemarble`, `8079:80`, `6379:6379`)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/CONTRIBUTING.md around lines 273 - 280, Add a short, explicit
"local-only" warning right after the block that lists the default Redis values,
stating that REDIS_URL and REDIS_TOKEN (as shown in apps/api/.dev.vars and
apps/cms/.env) and the SRH_TOKEN/ports in docker-compose.yml are for local
development only and must not be used in staging/production; reference the
specific defaults (`REDIS_URL=http://localhost:8079`,
`REDIS_TOKEN=justusemarble`, `SRH_TOKEN=justusemarble`, ports 8079 and 6379) and
suggest replacing them with secure credentials or environment-specific values
before deploying.

Comment on lines +51 to +52
REDIS_URL=http://localhost:8079
REDIS_TOKEN=justusemarble
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Reorder Redis keys to satisfy dotenv-linter.

REDIS_TOKEN should be declared before REDIS_URL to avoid recurring linter warnings.

🔧 Proposed fix
-REDIS_URL=http://localhost:8079
-REDIS_TOKEN=justusemarble
+REDIS_TOKEN=justusemarble
+REDIS_URL=http://localhost:8079
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
REDIS_URL=http://localhost:8079
REDIS_TOKEN=justusemarble
REDIS_TOKEN=justusemarble
REDIS_URL=http://localhost:8079
🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 52-52: [UnorderedKey] The REDIS_TOKEN key should go before the REDIS_URL key

(UnorderedKey)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/cms/.env.example` around lines 51 - 52, The .env.example has Redis keys
in the wrong order for dotenv-linter; move the REDIS_TOKEN entry so it appears
before REDIS_URL (i.e., swap the two lines) to satisfy the linter—update the
REDIS_TOKEN and REDIS_URL entries in apps/cms/.env.example accordingly.

@vercel
Copy link

vercel bot commented Mar 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marble-app Ready Ready Preview, Comment Mar 3, 2026 1:44pm
marble-web Error Error Mar 3, 2026 1:44pm

Request Review

Copy link
Member

@taqh taqh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@taqh taqh merged commit 19425bc into usemarble:main Mar 3, 2026
7 checks passed
@Hashversion Hashversion deleted the feature/postgres-redis-local branch March 3, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants