-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (29 loc) · 854 Bytes
/
Dockerfile
File metadata and controls
42 lines (29 loc) · 854 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
35
36
37
38
39
40
41
42
# ---- Build Stage ----
FROM node:20-slim AS builder
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY tsconfig.json ./
COPY src/ ./src/
RUN npm run build
# ---- Production Stage ----
FROM node:20-slim
# Install common CLI tools that txtcode tools may invoke
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
curl \
iputils-ping \
dnsutils \
procps \
&& rm -rf /var/lib/apt/lists/*
# Signal that we're running inside Docker (used by keychain fallback)
ENV TXTCODE_DOCKER=1
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev --ignore-scripts 2>/dev/null || npm ci --omit=dev
COPY --from=builder /app/dist ./dist
# Default workspace mount point
RUN mkdir -p /workspace /root/.txtcode
WORKDIR /workspace
ENTRYPOINT ["node", "/app/dist/cli/index.js"]