-
-
Notifications
You must be signed in to change notification settings - Fork 521
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (22 loc) · 639 Bytes
/
Dockerfile
File metadata and controls
33 lines (22 loc) · 639 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Stage 1: Build
FROM node:lts-bookworm AS builder
WORKDIR /app
COPY package*.json ./
COPY worker/package*.json ./worker/
RUN npm ci
RUN cd worker && npm ci
# Copy all source files
COPY . .
# Build the Next.js application
RUN npx @cloudflare/next-on-pages
# Stage 2: Production
FROM node:lts-bookworm AS production
# Install bash and curl for runtime
RUN apt-get update && apt-get install -y curl cron
# Copy runtime dependencies from builder stage
COPY --from=builder /app/ /app/
COPY --from=builder /app/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Expose the Pages port
EXPOSE 8788
ENTRYPOINT ["/entrypoint.sh"]