From 4358ff8ead9d192d0b824dc74484ad381aa0a42f Mon Sep 17 00:00:00 2001 From: Paul Fitzpatrick Date: Wed, 5 Jun 2024 14:29:44 -0400 Subject: [PATCH] include pyodide in the docker image (#1019) Grist has for some time supported a sandbox based on pyodide. It is a bit slower to start than the gvisor-based sandbox, but can run in situations where it can't. Until now it hasn't been easy to use when running Grist as a container, since the support files weren't included. This change rectifies that omission. Nothing changes by default. But now if you start Grist as a container and set `GRIST_SANDBOX_FLAVOR=pyodide`, it should work rather than fail. --- Dockerfile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Dockerfile b/Dockerfile index 20a645e7..50e5cc6c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,6 +35,12 @@ COPY stubs /grist/stubs COPY buildtools /grist/buildtools RUN yarn run build:prod +# Prepare material for optional pyodide sandbox +COPY sandbox/pyodide /grist/sandbox/pyodide +COPY sandbox/requirements3.txt /grist/sandbox/requirements3.txt +RUN \ + cd /grist/sandbox/pyodide && make setup + ################################################################################ ## Python collection stage ################################################################################ @@ -108,6 +114,9 @@ ADD sandbox /grist/sandbox ADD plugins /grist/plugins ADD static /grist/static +# Make optional pyodide sandbox available +COPY --from=builder /grist/sandbox/pyodide /grist/sandbox/pyodide + # Finalize static directory RUN \ mv /grist/static-built/* /grist/static && \