From 93a63d3714bfbfcf97a231f5519911250f929181 Mon Sep 17 00:00:00 2001 From: IThundxr Date: Fri, 17 Feb 2023 22:09:50 -0500 Subject: [PATCH] feat: use ENTRYPOINT in docker (#286) * :3 * Update Dockerfile Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com> * Update Dockerfile Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com> * Update Dockerfile Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com> * test --------- Co-authored-by: dicedtomato <35403473+diced@users.noreply.github.com> --- Dockerfile | 8 +++++--- docker-entrypoint.sh | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index f7e6335..44bc037 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ RUN yarn build # Use Alpine Linux as the final image FROM base -RUN apk add --no-cache perl procps +RUN apk add --no-cache perl procps tini COPY --from=builder /prisma-engines /prisma-engines ENV PRISMA_QUERY_ENGINE_BINARY=/prisma-engines/query-engine \ @@ -66,5 +66,7 @@ COPY --from=builder /zipline/node_modules ./node_modules COPY --from=builder /zipline/node_modules/.prisma/client ./node_modules/.prisma/client COPY --from=builder /zipline/node_modules/@prisma/client ./node_modules/@prisma/client -# Run the application -CMD ["node", "--enable-source-maps", "dist/index.js"] \ No newline at end of file +# Copy Startup Script +COPY docker-entrypoint.sh /zipline + +ENTRYPOINT ["tini", "--", "/zipline/docker-entrypoint.sh"] \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..7ea9750 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +set -e + +node --enable-source-maps dist/index.js \ No newline at end of file