Complete Node.js container implementation with multi-version support
- Add Dockerfile with AlmaLinux 9 base, Nginx reverse proxy, and PM2
- Support Node.js versions 18, 20, 22 with automated installation
- Implement memory-optimized configuration (256MB minimum, 512MB recommended)
- Add Memcached session storage for development environments
- Create comprehensive documentation (README, USER-GUIDE, MEMORY-GUIDE, CLAUDE.md)
- Include example applications (simple website and REST API)
- Add Gitea CI/CD pipeline for automated multi-version builds
- Provide local development script with helper utilities
- Implement health monitoring, log rotation, and backup systems
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 16:00:46 -07:00
|
|
|
FROM almalinux/9-base
|
|
|
|
ARG NODEVER=20
|
|
|
|
|
|
|
|
# Install repos, update, install only needed packages, clean up in one layer
|
|
|
|
RUN dnf install -y \
|
|
|
|
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
|
|
|
|
dnf update -y && \
|
2025-07-24 09:01:08 -07:00
|
|
|
dnf install -y wget procps cronie iproute nginx openssl git microdnf make gcc gcc-c++ && \
|
2025-07-24 09:03:33 -07:00
|
|
|
dnf group install -y 'Development Tools' && \
|
Complete Node.js container implementation with multi-version support
- Add Dockerfile with AlmaLinux 9 base, Nginx reverse proxy, and PM2
- Support Node.js versions 18, 20, 22 with automated installation
- Implement memory-optimized configuration (256MB minimum, 512MB recommended)
- Add Memcached session storage for development environments
- Create comprehensive documentation (README, USER-GUIDE, MEMORY-GUIDE, CLAUDE.md)
- Include example applications (simple website and REST API)
- Add Gitea CI/CD pipeline for automated multi-version builds
- Provide local development script with helper utilities
- Implement health monitoring, log rotation, and backup systems
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 16:00:46 -07:00
|
|
|
dnf clean all && \
|
|
|
|
rm -rf /var/cache/dnf /usr/share/doc /usr/share/man /usr/share/locale/* \
|
|
|
|
/var/cache/yum /tmp/* /var/tmp/*
|
|
|
|
|
|
|
|
# Copy scripts into the image and set permissions
|
|
|
|
COPY ./scripts/ /scripts/
|
|
|
|
RUN chmod +x /scripts/*
|
|
|
|
|
|
|
|
# Generate self-signed cert, create needed dirs, install Node.js, clean up
|
|
|
|
RUN openssl req -newkey rsa:2048 -nodes -keyout /etc/pki/tls/private/localhost.key -x509 -days 3650 -subj "/CN=localhost" -out /etc/pki/tls/certs/localhost.crt && \
|
|
|
|
mkdir -p /var/log/nodejs && \
|
|
|
|
/scripts/install-node$NODEVER.sh && \
|
|
|
|
rm -rf /tmp/*
|
|
|
|
|
|
|
|
# Install PM2 globally for process management with minimal footprint
|
|
|
|
RUN npm install -g pm2@latest --production && \
|
|
|
|
npm cache clean --force && \
|
|
|
|
rm -rf /tmp/*
|
|
|
|
|
2025-07-24 09:01:08 -07:00
|
|
|
# Copy nginx config
|
Complete Node.js container implementation with multi-version support
- Add Dockerfile with AlmaLinux 9 base, Nginx reverse proxy, and PM2
- Support Node.js versions 18, 20, 22 with automated installation
- Implement memory-optimized configuration (256MB minimum, 512MB recommended)
- Add Memcached session storage for development environments
- Create comprehensive documentation (README, USER-GUIDE, MEMORY-GUIDE, CLAUDE.md)
- Include example applications (simple website and REST API)
- Add Gitea CI/CD pipeline for automated multi-version builds
- Provide local development script with helper utilities
- Implement health monitoring, log rotation, and backup systems
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 16:00:46 -07:00
|
|
|
COPY ./configs/nginx.conf /etc/nginx/nginx.conf
|
2025-07-24 09:01:08 -07:00
|
|
|
|
|
|
|
# Copy examples directory for default app fallback
|
|
|
|
COPY ./examples/ /examples/
|
Complete Node.js container implementation with multi-version support
- Add Dockerfile with AlmaLinux 9 base, Nginx reverse proxy, and PM2
- Support Node.js versions 18, 20, 22 with automated installation
- Implement memory-optimized configuration (256MB minimum, 512MB recommended)
- Add Memcached session storage for development environments
- Create comprehensive documentation (README, USER-GUIDE, MEMORY-GUIDE, CLAUDE.md)
- Include example applications (simple website and REST API)
- Add Gitea CI/CD pipeline for automated multi-version builds
- Provide local development script with helper utilities
- Implement health monitoring, log rotation, and backup systems
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 16:00:46 -07:00
|
|
|
|
|
|
|
# Set up cron job for log rotation
|
|
|
|
RUN echo "15 */12 * * * root /scripts/log-rotate.sh" >> /etc/crontab
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
|
2025-07-21 16:05:37 -07:00
|
|
|
CMD wget --spider -q http://localhost:3000/ping || exit 1
|
Complete Node.js container implementation with multi-version support
- Add Dockerfile with AlmaLinux 9 base, Nginx reverse proxy, and PM2
- Support Node.js versions 18, 20, 22 with automated installation
- Implement memory-optimized configuration (256MB minimum, 512MB recommended)
- Add Memcached session storage for development environments
- Create comprehensive documentation (README, USER-GUIDE, MEMORY-GUIDE, CLAUDE.md)
- Include example applications (simple website and REST API)
- Add Gitea CI/CD pipeline for automated multi-version builds
- Provide local development script with helper utilities
- Implement health monitoring, log rotation, and backup systems
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-21 16:00:46 -07:00
|
|
|
|
|
|
|
ENTRYPOINT [ "/scripts/entrypoint.sh" ]
|