Harden deployment and JSON-LD output

- Dockerfile: node:24-alpine base image
- compose: bind port 3000 to localhost so traffic goes through nginx
- JsonLd: escape '<' so data can't break out of the script tag
This commit is contained in:
iamdoubz committed 2026-10-29 11:38:09 -05:00
1 parent 8d730c1c12
commit 9964e86d1a
3 files changed
+4 -3

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
FROM node:22-alpine AS base
FROM node:24-alpine AS base
# ── deps ──────────────────────────────────────────────────────────────
FROM base AS deps
+1 -1
View File
@@ -5,6 +5,6 @@ services:
dockerfile: Dockerfile
container_name: daniel-me
ports:
- "3000:3000"
- "127.0.0.1:3000:3000"
env_file: .env.local
restart: unless-stopped
+2 -1
View File
@@ -3,7 +3,8 @@ export function JsonLd({ data }: { data: Record<string, unknown> }) {
return (
<script
type="application/ld+json"
dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}
// Escape "<" so a "</script>" in post data can't close the tag early.
dangerouslySetInnerHTML={{ __html: JSON.stringify(data).replace(/</g, "\\u003c") }}
/>
);
}