-
Notifications
You must be signed in to change notification settings - Fork 81
Expand file tree
/
Copy pathDockerfile.dev
More file actions
28 lines (20 loc) · 833 Bytes
/
Dockerfile.dev
File metadata and controls
28 lines (20 loc) · 833 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
# Dockerfile.dev
#
# Development image only — NOT for production.
# Uses ts-node-dev for live TypeScript reload on file changes.
FROM node:20-alpine
# Install curl for the healthcheck in docker-compose
RUN apk add --no-cache curl
WORKDIR /app
# Copy manifests first to leverage layer caching
COPY package*.json ./
# Install all deps including devDependencies (needed for ts-node-dev)
RUN npm ci
# Copy the rest of the source (overridden by the bind mount at runtime)
COPY . .
EXPOSE 3000
# ts-node-dev watches for file changes and restarts automatically.
# --respawn — restart on crash
# --transpile-only — skip type checking for faster restarts
# --ignore-watch node_modules — don't watch node_modules
CMD ["npx", "ts-node-dev", "--respawn", "--transpile-only", "--ignore-watch", "node_modules", "src/index.ts"]