-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (31 loc) · 894 Bytes
/
Copy pathDockerfile
File metadata and controls
43 lines (31 loc) · 894 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
43
# syntax=docker/dockerfile:1
FROM node:22-alpine@sha256:16e22a550f3863206a3f701448c45f7912c6896a62de43add43bb9c86130c3e2
# Install dependencies
RUN apk add --no-cache \
bash \
curl \
git \
openssl \
ca-certificates
WORKDIR /app
# Copy package files
COPY package*.json ./
COPY tsconfig.json ./
# Install dependencies
RUN npm ci && \
npm cache clean --force
# Copy source code
COPY . .
# Build TypeScript
RUN npm run build
# Ensure docs directory exists for /ui static files
RUN mkdir -p docs
# Docker environment marker (tells server.ts to bind to 0.0.0.0)
ENV DOCKER=true
# Expose port
EXPOSE 3333
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3333/api/health || exit 1
# Default command: run the server (not interactive CLI)
CMD ["npm", "run", "server"]