-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (26 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
38 lines (26 loc) · 1.1 KB
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
35
36
37
38
# syntax=docker/dockerfile:1
# --- Stage 1: Cache dependencies ---
FROM docker.io/denoland/deno:2.3.2 AS deps
WORKDIR /app
# Copy only dependency manifests first for optimal layer caching.
# This layer is only rebuilt when dependencies change.
COPY deno.json deno.lock ./
# Pre-cache all dependencies without running the app
RUN deno install --frozen
# --- Stage 2: Final image ---
FROM docker.io/denoland/deno:2.3.2
LABEL org.opencontainers.image.title="jmap-mcp" \
org.opencontainers.image.description="MCP server for JMAP email management" \
org.opencontainers.image.source="https://github.com/wyattjoh/jmap-mcp" \
org.opencontainers.image.licenses="MIT"
WORKDIR /app
# Bring in the pre-cached dependency tree from the deps stage
COPY --from=deps /deno-dir /deno-dir
# Copy application source
COPY deno.json deno.lock ./
COPY src/ src/
# Type-check and cache the application ahead of time so startup is instant
RUN deno check src/mod.ts
# Drop to non-root user (provided by the official Deno image)
USER deno
ENTRYPOINT ["deno", "run", "--allow-env", "--allow-net", "--cached-only", "src/mod.ts"]