I'm struggling with implementing a CI/CD pipeline for a NuxtHub application deployed via Docker.
When building the application on the same server where it runs, everything works fine. However, when moving to a CI/CD flow (building a Docker image in a pipeline to be pulled later by the production/test server), I encounter issues with storage drivers.
The Problem
It seems that many configurations for KV, Cache, and Blob are evaluated/baked in during the build process.
-
If the environment variables (like Redis credentials for KV) are not present during nuxt build, the application defaults to the filesystem driver instead of the intended production driver.
-
This makes the Docker image "environment-aware" at build time, which contradicts the "build once, run anywhere" principle of Docker.
Current Behavior
Currently, if REDIS_URL (or similar) is missing during the Docker build phase, the generated Nitro chunks don't seem to switch to the correct remote/production drivers even if those variables are provided later at runtime.
Questions / Clarifications
- Is this behavior intended, or is it a limitation of the current integration between NuxtHub and Nitro?
- What is the recommended way to handle CI/CD for Docker deployments where the build environment has no access to the production/test databases?
- Are there plans to allow more flexible runtime-only configuration for these storage layers without relying on build-time environment detection?
I would appreciate some guidance on whether I should change my CI/CD approach or if there are specific flags/configs to force remote drivers during build.
I'm struggling with implementing a CI/CD pipeline for a NuxtHub application deployed via Docker.
When building the application on the same server where it runs, everything works fine. However, when moving to a CI/CD flow (building a Docker image in a pipeline to be pulled later by the production/test server), I encounter issues with storage drivers.
The Problem
It seems that many configurations for KV, Cache, and Blob are evaluated/baked in during the build process.
If the environment variables (like Redis credentials for KV) are not present during nuxt build, the application defaults to the filesystem driver instead of the intended production driver.
This makes the Docker image "environment-aware" at build time, which contradicts the "build once, run anywhere" principle of Docker.
Current Behavior
Currently, if REDIS_URL (or similar) is missing during the Docker build phase, the generated Nitro chunks don't seem to switch to the correct remote/production drivers even if those variables are provided later at runtime.
Questions / Clarifications
I would appreciate some guidance on whether I should change my CI/CD approach or if there are specific flags/configs to force remote drivers during build.