From 2099ab6153e2eb2451c6ac60c26c64e717bab0cf Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Fri, 19 Jan 2024 02:10:35 +0800 Subject: [PATCH] Workaround --- docker/Dockerfile | 2 +- extra/clean-tsx-tmp.js | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 extra/clean-tsx-tmp.js diff --git a/docker/Dockerfile b/docker/Dockerfile index ce83059..2e167a8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -26,7 +26,7 @@ VOLUME /app/data EXPOSE 5001 HEALTHCHECK --interval=60s --timeout=30s --start-period=60s --retries=5 CMD extra/healthcheck ENTRYPOINT ["/usr/bin/dumb-init", "--"] -CMD ["tsx", "./backend/index.ts"] +CMD ["bash", "-c", "node ./extra/clean-tsx-tmp.js && tsx ./backend/index.ts"] ############################################ # Mark as Nightly diff --git a/extra/clean-tsx-tmp.js b/extra/clean-tsx-tmp.js new file mode 100644 index 0000000..4e2e35b --- /dev/null +++ b/extra/clean-tsx-tmp.js @@ -0,0 +1,13 @@ +/* + * This script is used to clean up the tmp directory. + * A workaround for https://github.com/louislam/dockge/issues/353 + */ +import * as fs from "fs"; + +try { + fs.rmSync("/tmp/tsx-0", { + recursive: true, + }); +} catch (e) { + +}