Dockerfile.dev
Rama main · réplica de lectura del repositorio original.
# Ojuri RDA development Dockerfile with hot-reload support
FROM node:20-slim
# Install build dependencies
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install all dependencies (including devDependencies)
RUN npm ci
# Copy source code
COPY . .
# Build to populate dist/. The dist directory is excluded from the
# image by .dockerignore (build artefacts get rebuilt inside the
# container), so we have to compile here — `package.json:_moduleAliases`
# resolves `@shared/*` → `dist/*` at runtime, and without this step
# nodemon would crash on first load with "Cannot find module
# /app/dist/shared/error/app.error". nodemon still watches src/ for
# hot-reload; ts-node compiles changed files on-the-fly while dist/
# stays the source of truth for module-alias lookups.
RUN npm run build
# Environment variables
ENV NODE_ENV=development
ENV PORT=3000
EXPOSE 3000
# Use nodemon for hot-reload
CMD ["npm", "run", "start:dev"]