Add working docker & docker compose.

This commit is contained in:
srv1-54 2025-05-10 10:26:32 +08:00
parent e6b2bf3cbe
commit 69db408fe2

View File

@ -10,7 +10,7 @@
# Install dependencies # Install dependencies
RUN bun pm untrusted RUN bun pm untrusted
RUN bun install --prod RUN bun install
# Copy source files # Copy source files
COPY . . COPY . .
@ -26,19 +26,9 @@
# Copy package files for production # Copy package files for production
COPY --from=builder /app/package.json ./ 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 build outputs from builder
COPY --from=builder /app /build COPY --from=builder /app/.output /app/.output
RUN /copy-builds.sh && rm -rf /build /copy-builds.sh
# Install production dependencies
RUN bun install --production RUN bun install --production
EXPOSE 3000 EXPOSE 3000