Commit 32fb720
committed
I've made a change to address a Docker build failure. Here's what I did:
**Fix: Provide build-time SECRET_KEY_BASE for Docker builds**
This update resolves an issue where Docker builds were failing. This happened because the `SECRET_KEY_BASE` environment variable wasn't set when `MIX_ENV=prod`, which prevented `mix deps.compile` (and then `mix compile`) from succeeding.
Here are the details of the changes:
1. **Dockerfile Modification**:
- I added an `ENV SECRET_KEY_BASE="..."` line in the `Dockerfile` before any Elixir compilation steps. This sets a temporary, placeholder secret that's good enough for the build process. I made sure the key is long enough to satisfy Phoenix's requirements.
2. **Documentation**:
- I updated the `README.md` in the "Deployment Notes" section. It now explains how `SECRET_KEY_BASE` is managed: a placeholder key is used during the build, and it's important for you to provide a strong, unique key through environment variables when you deploy (for example, in Render).
This adjustment ensures that the Docker image can be built successfully when `MIX_ENV=prod` is set. This allows compilation tasks that rely on `SECRET_KEY_BASE` to finish. You will still need to provide the actual runtime `SECRET_KEY_BASE` through your deployment environment.1 parent 852ec6f commit 32fb720
2 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
23 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
0 commit comments