FROM denoland/deno:alpine AS builder WORKDIR /app COPY . . # Build the Fresh application RUN deno task build # Pre-cache the application dependencies RUN deno cache main.ts FROM denoland/deno:alpine WORKDIR /app # Copy the Deno cache COPY --from=builder /deno-dir/ /deno-dir/ # Copy application code including both static directories COPY --from=builder /app/ /app/ # Ensure static assets directories permissions are set correctly RUN chmod -R 755 /app/static /app/_fresh/static ENV DENO_DEPLOYMENT=production EXPOSE 8000 # Run with appropriate flags for static file serving CMD ["run", "--allow-net", "--allow-read", "--allow-env", "main.ts"]