Project-Image-Uploader/frontend/Dockerfile.dev
matthias.lotz 80ffcfd210 docs: complete migration documentation and finalize dev environment
- Add comprehensive CHANGELOG.md with all upgrade phases and results
- Update TODO.md to mark framework upgrades as completed
- Update UPGRADE_PLAN with actual timelines and detailed phase results
- Finalize docker-compose.override.yml and Dockerfile.dev for dev workflow
- Update package-lock.json after dependency changes

All 4 phases completed successfully:
- Backend: Node 14 → 24
- Frontend: React 17 → 18.3.1, Router v5 → v6, MUI v4 → v5
- Dev environment with HMR fully functional
- Integration smoke tests passed
2025-10-29 23:11:37 +01:00

43 lines
1.3 KiB
Docker

FROM node:18-bullseye
# Install nginx and bash
RUN apt-get update \
&& apt-get install -y --no-install-recommends nginx procps bash ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user for dev
RUN useradd -m appuser || true
WORKDIR /app
# Copy package files first to leverage Docker cache for npm install
COPY package*.json ./
COPY env.sh ./
COPY nginx.dev.conf /etc/nginx/conf.d/default.conf
# Make /app owned by the non-root user, then run npm as that user so
# node_modules are created with the correct owner and we avoid an expensive
# recursive chown later.
RUN chown appuser:appuser /app || true
USER appuser
# Install dependencies as non-root (faster overall because we avoid chown -R)
# Use npm ci without legacy peer deps to get a clean, reproducible install
RUN npm ci --no-audit --no-fund
# Switch back to root to add the start script and adjust nginx paths
USER root
COPY start-dev.sh /start-dev.sh
RUN chmod +x /start-dev.sh
# Ensure nginx log/lib dirs are writable by the app user (small set)
RUN chown -R appuser:appuser /var/lib/nginx /var/log/nginx || true
# Remove default Debian nginx site so our dev config becomes the active default
RUN rm -f /etc/nginx/sites-enabled/default || true
USER appuser
EXPOSE 80 3000
CMD ["/start-dev.sh"]