Fix playwright-server docker image not exiting (#33099)
* Fix playwright-server docker image not exiting ... by wrapping with tini * Remove redundant `npm exec` * Update packages/playwright-common/Dockerfile * missing comma
This commit is contained in:
@@ -12,4 +12,13 @@ RUN npm i -g playwright@${PLAYWRIGHT_VERSION}
|
|||||||
|
|
||||||
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
||||||
|
|
||||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
# We use `docker-init` as PID 1, which means that the container shuts down correctly on SIGTERM.
|
||||||
|
#
|
||||||
|
# (The problem is that PID 1 doesn't get default signal handlers, and
|
||||||
|
# playwright server doesn't register a SIGTERM handler, so if that ends up as
|
||||||
|
# PID 1, then it ignores SIGTERM. Likewise bash doesn't set a SIGTERM handler by default.
|
||||||
|
#
|
||||||
|
# The easiest solution is to use docker-init, which is in fact `tini` (https://github.com/krallin/tini).
|
||||||
|
#
|
||||||
|
# See https://github.com/krallin/tini/issues/8#issuecomment-146135930 for a good explanation of all this.)
|
||||||
|
ENTRYPOINT ["/usr/bin/docker-init", "/docker-entrypoint.sh"]
|
||||||
|
|||||||
@@ -1,4 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
exec /usr/bin/playwright run-server --port "$PORT" --host 0.0.0.0
|
||||||
# We use npm here as we used `npm i -g` to install playwright in the Dockerfile
|
|
||||||
npm exec -- playwright run-server --port "$PORT" --host 0.0.0.0
|
|
||||||
|
|||||||
Reference in New Issue
Block a user