From fefc7e4e4ae0d60cce2d8e47f5c89382c67b7ddc Mon Sep 17 00:00:00 2001 From: 0xJordan Date: Mon, 23 Dec 2024 01:12:05 +0100 Subject: [PATCH] feat(Dockerfile): simplify Dockerfile by combining COPY commands and add entrypoint script for better process management feat(entrypoint.sh): create entrypoint script to handle dependency installation and application startup --- Dockerfile | 15 ++++++--------- entrypoint.sh | 4 ++++ 2 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index d28d5ba..abd8190 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,13 @@ FROM oven/bun:latest as base # Copy the lock and package file -COPY bun.lockb . -COPY package.json . - -# Install dependencies -RUN bun install - -RUN ls -al node_modules/@actions/core +COPY bun.lockb package.json ./ # Copy source code COPY src ./src -# Run the action -CMD ["bun", "run", "src/index.ts"] +COPY entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..3c8ce70 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh -l + +bun install +bun run src/index.ts \ No newline at end of file