atri.dad/Dockerfile
Atridad Lahiji f859a12d2c
All checks were successful
Docker Deploy / build-and-push (push) Successful in 5m11s
Remove the weird ass cache stuff. Thanks stack overflow!
2025-04-24 13:14:42 -06:00

35 lines
942 B
Docker

FROM denoland/deno:alpine AS builder
WORKDIR /app
# Install build dependencies for native modules
RUN apk add --no-cache build-base python3
COPY . .
# Create node_modules directory and install dependencies
RUN deno cache -r main.ts
# 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
WORKDIR /app
# Copy the Deno cache and node_modules
COPY --from=builder /deno-dir/ /deno-dir/
COPY --from=builder /app/node_modules/ /app/node_modules/
# Copy application code
COPY --from=builder /app/ /app/
# Ensure static assets directories permissions are set correctly
RUN chmod -R 755 /app/static /app/_fresh
ENV DENO_DEPLOYMENT=production
EXPOSE 8000
# Run with appropriate flags for static file serving
CMD ["run", "--allow-net", "--allow-read", "--allow-env", "--node-modules-dir", "main.ts"]