From 401e5310af52bb996fb74df8921542ed1074701a Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Thu, 29 Oct 2026 21:21:37 -0600 Subject: [PATCH] Add sample.env template and ignore .env - Provide a documented `sample.env` to copy into `.env` for port configuration - Exclude `.env` from Docker builds and git tracking to avoid leaking secrets - Update README to mention the new env file workflow --- .dockerignore | 1 + .gitignore | 1 + README.md | 4 ++-- sample.env | 8 ++++++++ 4 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 sample.env diff --git a/.dockerignore b/.dockerignore index a616e64..1b0de87 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,3 +6,4 @@ snapshots Dockerfile docker-compose.yml .dockerignore +.env diff --git a/.gitignore b/.gitignore index 27083f1..cfe4534 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules dist snapshots *.log +.env diff --git a/README.md b/README.md index 8e08f23..338ab11 100644 --- a/README.md +++ b/README.md @@ -20,8 +20,8 @@ docker compose --profile dev up --build dev # Vite dev server with hot reload docker compose down # stop ``` -Change the host ports with `PIXELTATION_PORT` / `PIXELTATION_DEV_PORT` -(e.g. `PIXELTATION_PORT=3000 docker compose up -d`). The dev service bind-mounts the project, +Change the host ports with `PIXELTATION_PORT` / `PIXELTATION_DEV_PORT`, either inline +(e.g. `PIXELTATION_PORT=3000 docker compose up -d`) or by copying `sample.env` to `.env` and editing it. The dev service bind-mounts the project, so edits on the host reload in the browser; don't run it and `npm run dev` on the same port at once. | File | Purpose | diff --git a/sample.env b/sample.env new file mode 100644 index 0000000..87b4a19 --- /dev/null +++ b/sample.env @@ -0,0 +1,8 @@ +# Copy to .env (`cp sample.env .env`) and adjust. Docker Compose reads .env automatically. +# Both values are optional; the defaults below are used when a variable is unset. + +# Host port for the production site (nginx), `docker compose up`. +PIXELTATION_PORT=8080 + +# Host port for the Vite dev server, `docker compose --profile dev up dev`. +PIXELTATION_DEV_PORT=5173