againagain
Some checks failed
Docker Deploy / build-and-push (push) Failing after 5m51s

This commit is contained in:
Atridad Lahiji 2025-04-24 13:03:04 -06:00
parent 6194678607
commit a50e73bb55
Signed by: atridad
SSH key fingerprint: SHA256:LGomp8Opq0jz+7kbwNcdfTcuaLRb5Nh0k5AchDDb438

View file

@ -2,30 +2,37 @@ FROM denoland/deno:alpine AS builder
WORKDIR /app WORKDIR /app
# Install build dependencies for native modules
RUN apk add --no-cache build-base python3
COPY . . COPY . .
# Build the Fresh application # Create node_modules directory and install dependencies
RUN deno task build RUN deno cache -r main.ts
# Pre-cache the application dependencies # Pre-cache npm deps with proper node_modules setup
RUN deno cache main.ts RUN deno task npm:init || echo "No npm:init task defined, continuing"
# Build Fresh application in a more controlled way (without task)
RUN deno run -A dev.ts build || deno run -A --unstable-worker-options --node-modules-dir main.ts build
FROM denoland/deno:alpine FROM denoland/deno:alpine
WORKDIR /app WORKDIR /app
# Copy the Deno cache # Copy the Deno cache and node_modules
COPY --from=builder /deno-dir/ /deno-dir/ COPY --from=builder /deno-dir/ /deno-dir/
COPY --from=builder /app/node_modules/ /app/node_modules/
# Copy application code including both static directories # Copy application code
COPY --from=builder /app/ /app/ COPY --from=builder /app/ /app/
# Ensure static assets directories permissions are set correctly # Ensure static assets directories permissions are set correctly
RUN chmod -R 755 /app/static /app/_fresh/static RUN chmod -R 755 /app/static /app/_fresh
ENV DENO_DEPLOYMENT=production ENV DENO_DEPLOYMENT=production
EXPOSE 8000 EXPOSE 8000
# Run with appropriate flags for static file serving # Run with appropriate flags for static file serving
CMD ["run", "--allow-net", "--allow-read", "--allow-env", "main.ts"] CMD ["run", "--allow-net", "--allow-read", "--allow-env", "--node-modules-dir", "main.ts"]