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