feat: update postgres image and add local Redis services#314
feat: update postgres image and add local Redis services#314taqh merged 1 commit intousemarble:mainfrom
Conversation
- 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
|
@Hashversion is attempting to deploy a commit to the Marble Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe 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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
There was a problem hiding this comment.
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-httpcan come up before Redis is actually ready, which may cause transient failures during local boot. Currently, Redis has no healthcheck andserverless-redis-httplacks adepends_oncondition 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
📒 Files selected for processing (4)
.github/CONTRIBUTING.mdapps/api/.dev.vars.exampleapps/cms/.env.exampledocker-compose.yml
| 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`) |
There was a problem hiding this comment.
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.
| 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.
| REDIS_URL=http://localhost:8079 | ||
| REDIS_TOKEN=justusemarble |
There was a problem hiding this comment.
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.
| 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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Description
This PR improves the local development stack by:
bitnami/postgresql:15to the officialpostgres:15imageredisandserverless-redis-httpservices todocker-composeREDIS_URLandREDIS_TOKENdefaults in API and CMS environment examplesCONTRIBUTING.mdMotivation 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-composefor 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
Summary by CodeRabbit
Release Notes
Documentation
Chores