forked from xixu-me/xget
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 966 Bytes
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 966 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
34
# --- Stage 1: build the Worker with Wrangler -----------------------
FROM node:25-alpine AS builder
WORKDIR /app
# Install dependencies & wrangler
COPY package*.json wrangler.toml ./
RUN npm ci
# Copy source and build
COPY src ./src
RUN npx wrangler deploy --dry-run --outdir=dist
# --- Stage 2: minimal runtime with workerd -------------------------
FROM node:25-slim AS runtime
# Install ca-certificates for SSL, then install workerd via npm
RUN apt-get update && \
apt-get install -y ca-certificates && \
rm -rf /var/lib/apt/lists/* && \
npm install -g @cloudflare/workerd-linux-64 && \
ln -s /usr/local/lib/node_modules/@cloudflare/workerd-linux-64/bin/workerd /usr/local/bin/workerd && \
workerd --version
WORKDIR /worker
# Bring in the compiled Worker bundle and config
COPY --from=builder /app/dist ./dist
COPY config.capnp ./config.capnp
# Expose the port workerd listens on
EXPOSE 8080
CMD ["workerd", "serve", "config.capnp"]