status-page:0.9 was built from a directory that holds a local .env with an API token, a Mac-installed node_modules, logs and Git metadata. COPY . . took all of it.
Look inside the image:
sh
ls -a
docker run --rm status-page:0.9 ls -a /app
docker run --rm status-page:0.9 cat /app/.envCreate .dockerignore next to the Dockerfile with one pattern per line, press Save, and rebuild. Start with .env, then add node_modules, logs and .git:
Compare the transferring context size with the earlier build, check the image again, and run it:
sh
docker run --rm status-page:0.9 ls -a /app
docker run -d --name status -p 8080:3000 status-page:0.9
curl localhost:8080/health