677118bdc8
- Explicitly set NODE_ENV=development during npm install to include devDependencies - Add NODE_ENV=development environment variable in Dockerfile - Add fallback dev:node script using Node.js --watch flag - Ensure nodemon is installed with other development dependencies This fixes the "sh: nodemon: not found" error in the development container. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
45 lines
1006 B
Docker
45 lines
1006 B
Docker
FROM node:20-alpine
|
|
|
|
# Install MinIO client
|
|
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc && \
|
|
chmod +x mc && \
|
|
mv mc /usr/local/bin/
|
|
|
|
# Install development dependencies
|
|
RUN apk add --no-cache bash
|
|
|
|
# Create app directory
|
|
WORKDIR /app
|
|
|
|
# Create non-root user (same UID/GID as most development systems)
|
|
RUN addgroup -g 1000 -S nodejs && \
|
|
adduser -S nodejs -u 1000 -G nodejs
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install all dependencies (including devDependencies for development)
|
|
# Make sure NODE_ENV is not set to production during install
|
|
RUN NODE_ENV=development npm install
|
|
|
|
# Create necessary directories
|
|
RUN mkdir -p logs temp && \
|
|
chmod 755 logs temp
|
|
|
|
# Copy application files
|
|
COPY . .
|
|
|
|
# Change ownership of everything to nodejs user
|
|
RUN chown -R nodejs:nodejs /app
|
|
|
|
# Switch to non-root user
|
|
USER nodejs
|
|
|
|
# Set development environment
|
|
ENV NODE_ENV=development
|
|
|
|
# Expose port
|
|
EXPOSE 7510
|
|
|
|
# Start the application in development mode
|
|
CMD ["npm", "run", "dev"] |