ddev bootstrap: make app/.env optional, add .env.example
Fresh clones errored out on `ddev start` because the compose file's env_file: pointed at app/.env (gitignored). No env vars are actually required by the code — STATE_DIR is the only one and has a default. - Switch env_file to the path:+required:false form (Docker Compose 2.24+; bundled with DDEV) so missing app/.env is non-fatal. - Commit app/.env.example as documentation for contributors who do need overrides.
This commit is contained in:
@@ -11,8 +11,11 @@ services:
|
|||||||
restart: "no"
|
restart: "no"
|
||||||
expose:
|
expose:
|
||||||
- "4321"
|
- "4321"
|
||||||
|
# Optional so a fresh clone boots without manual prep. Contributors
|
||||||
|
# who need overrides can `cp app/.env.example app/.env` and edit.
|
||||||
env_file:
|
env_file:
|
||||||
- ../app/.env
|
- path: ../app/.env
|
||||||
|
required: false
|
||||||
environment:
|
environment:
|
||||||
HOST: "0.0.0.0"
|
HOST: "0.0.0.0"
|
||||||
PORT: "4321"
|
PORT: "4321"
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
# Local-dev environment variables for the emdash dev container.
|
||||||
|
# Copy this file to `app/.env` and edit if you need to override defaults.
|
||||||
|
# Loaded by .ddev/docker-compose.emdash.yaml (env_file, required: false) —
|
||||||
|
# everything here is optional; the dev server boots fine with no overrides.
|
||||||
|
|
||||||
|
# Override where emdash stores data.db and uploads/ on disk.
|
||||||
|
# Defaults to the working directory (which is /app inside the container).
|
||||||
|
# STATE_DIR=/app/state
|
||||||
|
|
||||||
|
# Astro / emdash:
|
||||||
|
# HOST, PORT, NODE_ENV, EMDASH_ALLOWED_ORIGINS, EMDASH_SITE_URL are set in
|
||||||
|
# the compose `environment:` block — set them here only to override.
|
||||||
Reference in New Issue
Block a user