-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 1.07 KB
/
Copy pathDockerfile
File metadata and controls
35 lines (25 loc) · 1.07 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
# OpenCode Remote Control — production image
# Multi-stage build: install deps → bundle dist → minimal runtime
FROM node:22-alpine AS base
# Install dumb-init for proper signal handling (PID 1 zombie reaping)
RUN apk add --no-cache dumb-init
WORKDIR /app
# Copy package files first (better Docker layer caching)
COPY package.json package-lock.json* ./
# Install production dependencies only
RUN npm ci --omit=dev --ignore-scripts
# Copy the prebuilt dist/ and scripts/
COPY dist/ ./dist/
COPY scripts/ ./scripts/
COPY bin/ ./bin/
COPY tsconfig.json ./
# State and logs directories (persistent volume)
RUN mkdir -p /root/.opencode-remote/state /root/.opencode-remote/logs
# Health check: HTTP endpoint returns 200 when child is alive with recent heartbeat
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:9090/health || exit 1
ENV NODE_ENV=production \
OPENCODE_TIMEOUT=180
# Run as PID 1 with dumb-init for proper signal forwarding
ENTRYPOINT ["dumb-init", "--"]
CMD ["node", "dist/cli.js"]