René's URL Explorer Experiment


Title: Why runtime environment variables for a pure static website are a bad idea - Nemanja Mitic

Open Graph Title: Why runtime environment variables for a pure static website are a bad idea - Nemanja Mitic

X Title: Why runtime environment variables for a pure static website are a bad idea - Nemanja Mitic

Description: Build and deploy a static website as a reusable Docker image, and see how practical it really is.

Open Graph Description: Build and deploy a static website as a reusable Docker image, and see how practical it really is.

X Description: Build and deploy a static website as a reusable Docker image, and see how practical it really is.

Mail addresses
nemanja.mitic.elfak@hotmail.com

Opengraph URL: https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables/

direct link

Domain: nemanjamitic.com

titleWhy runtime environment variables for a pure static website are a bad idea - Nemanja Mitic
authorNemanja Mitic
og:typewebsite
og:imagehttps://nemanjamitic.com/api/open-graph/blog/2025-12-21-static-website-runtime-environment-variables.png
twitter:cardsummary
twitter:urlhttps://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables/
twitter:imagehttps://nemanjamitic.com/api/open-graph/blog/2025-12-21-static-website-runtime-environment-variables.png
astro-view-transitions-enabledtrue
astro-view-transitions-fallbacknone

Links:

Nemanja Mitic https://nemanjamitic.com/
Blog https://nemanjamitic.com/blog/
Explore https://nemanjamitic.com/blog/explore/
Projects https://nemanjamitic.com/projects/
About https://nemanjamitic.com/about/
Gallery https://nemanjamitic.com/gallery/
Links https://nemanjamitic.com/links/
tips-and-tricks https://nemanjamitic.com/blog/categories/tips-and-tricks
Introduction https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#introduction
Goal https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#goal
Options https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#options
Implementation https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#implementation
Replacement script https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#replacement-script
Nginx image entrypoint https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#nginx-image-entrypoint
Setting the variables for test https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#setting-the-variables-for-test
Issues https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#issues
You can have only string variables https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#you-can-have-only-string-variables
You must handle URL-shaped variables separately https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#you-must-handle-url-shaped-variables-separately
Open Graph images with runtime data are impossible https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#open-graph-images-with-runtime-data-are-impossible
You must transform variables in client-side JavaScript https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#you-must-transform-variables-in-client-side-javascript
Completed code https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#completed-code
Conclusion https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#conclusion
References https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables#references
https://phase.dev/blog/nextjs-public-runtime-variables/https://phase.dev/blog/nextjs-public-runtime-variables/
https://nemanjamitic.com/blog/2025-12-13-nextjs-runtime-environment-variables#alternative-approacheshttps://nemanjamitic.com/blog/2025-12-13-nextjs-runtime-environment-variables#alternative-approaches
https://github.com/nemanjam/nemanjam.github.io/pull/28https://github.com/nemanjam/nemanjam.github.io/pull/28
scripts/replace-variables.shhttps://github.com/nemanjam/nemanjam.github.io/blob/feature/runtime-environment-variables/scripts/replace-variables.sh
docker/Dockerfilehttps://github.com/nemanjam/nemanjam.github.io/blob/feature/runtime-environment-variables/docker/Dockerfile
docker-compose.ymlhttps://github.com/nemanjam/nemanjam.github.io/blob/feature/runtime-environment-variables/docker-compose.yml
src/pages/api/open-graph/[…route].png.tshttps://gitlab.com/nemanjam/nemanjam.github.io/-/blob/feature/runtime-environment-variables/src/pages/api/open-graph/%5B...route%5D.png.ts
https://github.com/nemanjam/nemanjam.github.io/pull/28https://github.com/nemanjam/nemanjam.github.io/pull/28
https://nemanjamitic.com/blog/2025-12-13-nextjs-runtime-environment-variableshttps://nemanjamitic.com/blog/2025-12-13-nextjs-runtime-environment-variables
https://phase.dev/blog/nextjs-public-runtime-variables/https://phase.dev/blog/nextjs-public-runtime-variables/
#astro https://nemanjamitic.com/blog/tags/astro
#docker https://nemanjamitic.com/blog/tags/docker
X https://x.com/intent/tweet?url=https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables&text=Build and deploy a static website as a reusable Docker image, and see how practical it really is.&via=https://x.com/nemanja_codes
Facebook https://www.facebook.com/sharer/sharer.php?u=https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables
Reddit https://www.reddit.com/submit?url=https%3A%2F%2Fnemanjamitic.com%2Fblog%2F2025-12-21-static-website-runtime-environment-variables&title=Why runtime environment variables for a pure static website are a bad idea
LinkedIn https://www.linkedin.com/sharing/share-offsite/?url=https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables
Y Combinator http://news.ycombinator.com/submitlink?u=https://nemanjamitic.com/blog/2025-12-21-static-website-runtime-environment-variables&t=Why runtime environment variables for a pure static website are a bad idea
Build a random image component with Astro and React https://nemanjamitic.com/blog/2025-04-06-random-image-component
Expose home server with Rathole tunnel and Traefik https://nemanjamitic.com/blog/2025-04-29-rathole-traefik-home-server
Load balancing multiple Rathole tunnels with Traefik HTTP and TCP routers https://nemanjamitic.com/blog/2025-05-29-traefik-load-balancer
Merge pull requ... https://github.com/nemanjam/nemanjam.github.io/commit/467bf65ec010e6929c3b51caca2d94c01e75e519
link https://nemanjamitic.com/design/
Github https://github.com/nemanjam
LinkedIn https://www.linkedin.com/in/nemanja-mitic
RSS Feed https://nemanjamitic.com/api/feed.xml

Viewport: width=device-width,initial-scale=1


URLs of crawlers that visited me.