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
This commit is contained in:
parent
7977dbdd61
commit
401e5310af
|
|
@ -6,3 +6,4 @@ snapshots
|
||||||
Dockerfile
|
Dockerfile
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
.dockerignore
|
.dockerignore
|
||||||
|
.env
|
||||||
|
|
|
||||||
|
|
@ -2,3 +2,4 @@ node_modules
|
||||||
dist
|
dist
|
||||||
snapshots
|
snapshots
|
||||||
*.log
|
*.log
|
||||||
|
.env
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ docker compose --profile dev up --build dev # Vite dev server with hot reload
|
||||||
docker compose down # stop
|
docker compose down # stop
|
||||||
```
|
```
|
||||||
|
|
||||||
Change the host ports with `PIXELTATION_PORT` / `PIXELTATION_DEV_PORT`
|
Change the host ports with `PIXELTATION_PORT` / `PIXELTATION_DEV_PORT`, either inline
|
||||||
(e.g. `PIXELTATION_PORT=3000 docker compose up -d`). The dev service bind-mounts the project,
|
(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.
|
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 |
|
| File | Purpose |
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
Loading…
Reference in New Issue