From 078c2d4bd5d04722644fb04d6a99761f5b4266cf Mon Sep 17 00:00:00 2001 From: samanhappy Date: Sat, 5 Apr 2025 17:10:07 +0800 Subject: [PATCH] refactor: reorganize Dockerfile for improved clarity and structure --- Dockerfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index e02bc3e..f2dc63c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,26 @@ -FROM python:3.12-slim-bookworm +FROM python:3.12-slim-bookworm AS base + COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ -FROM node:22-alpine +RUN apt-get update && apt-get install -y curl gnupg \ + && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ + && apt-get install -y nodejs \ + && apt-get clean && rm -rf /var/lib/apt/lists/* -COPY entrypoint.sh /usr/local/bin/entrypoint.sh -RUN chmod +x /usr/local/bin/entrypoint.sh +RUN npm install -g pnpm WORKDIR /app COPY package.json pnpm-lock.yaml ./ -RUN npm install -g pnpm && pnpm install +RUN pnpm install COPY . . RUN pnpm build +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN chmod +x /usr/local/bin/entrypoint.sh + EXPOSE 3000 ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]