From 69db408fe2c4ec30aa1deb2dcfd6724d42536dc6 Mon Sep 17 00:00:00 2001 From: srv1-54 Date: Sat, 10 May 2025 10:26:32 +0800 Subject: [PATCH] Add working docker & docker compose. --- Dockerfile | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 03cc409..d819f8f 100755 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ # Install dependencies RUN bun pm untrusted - RUN bun install --prod + RUN bun install # Copy source files COPY . . @@ -26,21 +26,11 @@ # Copy package files for production COPY --from=builder /app/package.json ./ - # Create a shell script to handle build output copying - RUN echo '#!/bin/sh\n\ - for dir in ".output" "dist" "build" ".next"; do\n\ - if [ -d "/build/$dir" ]; then\n\ - mkdir -p "$dir"\n\ - fi\n\ - done' > /copy-builds.sh && chmod +x /copy-builds.sh - # Copy build outputs from builder - COPY --from=builder /app /build - RUN /copy-builds.sh && rm -rf /build /copy-builds.sh - - # Install production dependencies + COPY --from=builder /app/.output /app/.output + RUN bun install --production EXPOSE 3000 - CMD ["bun", "run", "start"] \ No newline at end of file + CMD ["bun", "run", "start"]