Dockerfile.dev•636 B
FROM node:20-alpine
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Copy .npmrc if it exists, otherwise configure npm to use public registry
COPY .npmrc* ./
RUN if [ ! -f .npmrc ]; then \
echo "No .npmrc found, using public registry"; \
npm config set registry https://registry.npmjs.org/ && \
npm config set strict-ssl true; \
fi
# Install dependencies
RUN npm install
# Install tsx as a dev dependency instead of globally
RUN npm install --save-dev tsx
# Expose port
EXPOSE 3000
# Command to run development server with hot reloading
CMD ["npx", "tsx", "watch", "src/index.ts"]