Closed sawyerh closed 2 months ago
app
St.:grey_question: |
Category | Percentage | Covered / Total |
---|---|---|---|
π’ | Statements | 93.1% | 81/87 |
π’ | Branches | 82.35% | 14/17 |
π’ | Functions | 93.33% | 14/15 |
π’ | Lines | 93.59% | 73/78 |
16 tests passing in 5 suites.
Report generated by π§ͺjest coverage report action from a3cb94693f7468623c051eba7d708571e1de668d
@sawyerh I think CMD ["HOSTNAME=0.0.0.0", "node", "server.js"]
doesn't work because the exec form of CMD (["executable", "arg1", "arg2"]
) invokes the executable directly without first invoking a shell, whereas the shell form (executable arg1 arg2
) invokes a shell which then invokes the executable. The HOSTNAME=0.0.0.0 isn't an executable so it can't be run, it's something that shells understand.
I'm surprised why the ENV HOSTNAME 0.0.0.0
doesn't work.
As an aside, it's considered best practice to use the ENV NAME=VAR
form (with equal sign) than the ENV NAME VAR
form without equal sign. See the following snippet from Docker docs:
This syntax does not allow for multiple environment-variables to be set in a single ENV instruction, and can be confusing. For example, the following sets a single environment variable (ONE) with value "TWO= THREE=world":
[ENV](https://docs.docker.com/reference/dockerfile/#env) ONE TWO= THREE=world
The alternative syntax is supported for backward compatibility, but discouraged for the reasons outlined above, and may be removed in a future release.
Ticket
Resolves #305
Changes
HOSTNAME
for the Docker container. This fixes an issue where the healthcheck fails after upgrading to Next.js 13.4.13+Context for reviewers
This was copied from the Next.js Docker example. I tried a few other formats, but none of those worked.
Testing
Tested on the Platform test app