Skip to content

Comments

Add Docker support with automatic Node version detection from .nvmrc#501

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-bbc03e62-469a-481e-b08a-6218862faaa3
Draft

Add Docker support with automatic Node version detection from .nvmrc#501
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-bbc03e62-469a-481e-b08a-6218862faaa3

Conversation

Copy link
Contributor

Copilot AI commented Aug 21, 2025

This PR adds comprehensive Docker support for AllKaraoke with automatic Node version detection from the .nvmrc file, making it easy to build and run the application in a containerized environment.

Features Added

🐳 Docker Configuration

  • Dockerfile: Multi-stage build using Node.js Alpine with configurable Node version via build args
  • docker-build.sh: Intelligent build script that automatically reads Node version from .nvmrc file
  • docker-compose.yml: Complete Docker Compose setup with health checks and environment configuration
  • .dockerignore: Optimized build context excluding unnecessary files for faster builds

📋 Node Version Detection

The Docker setup automatically detects and uses the Node version specified in .nvmrc:

# Reads Node version from .nvmrc (currently "20") and builds accordingly
./docker-build.sh

# Manual override also supported
docker build --build-arg NODE_VERSION=18 -t allkaraoke:latest .

🚀 Production-Ready Build Process

  • Uses pnpm package manager as specified in the project
  • Implements FAST_BUILD=1 flag to skip pre-rendering step (avoids Playwright browser dependencies)
  • Optimized layer caching for faster subsequent builds
  • Serves production build on port 3010 using pnpm start:production

📚 Documentation & Testing

  • DOCKER.md: Comprehensive documentation with usage examples and configuration options
  • test-docker-config.sh: Validation script ensuring all Docker files are correctly configured
  • docker-demo.sh: Interactive demo showing available Docker commands
  • Updated main README.md with Docker setup instructions

Usage Examples

# Quick start with automatic Node version detection
./docker-build.sh
docker run -p 3010:3010 allkaraoke:latest

# Using Docker Compose
docker-compose up

# With custom Node version
NODE_VERSION=18 docker-compose up --build

The application will be available at http://localhost:3010 when running in Docker.

Benefits

  • ✅ Consistent development and deployment environment
  • ✅ Automatic Node version management from .nvmrc
  • ✅ No need to install Node.js or pnpm locally
  • ✅ Production-ready configuration with health checks
  • ✅ Easy scaling and deployment with Docker Compose

This implementation fully addresses the requirement to "take node version from .nvmrc file if possible" while providing a complete containerization solution for the AllKaraoke application.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • o1.ingest.sentry.io
    • Triggering command: node /home/REDACTED/work/allkaraoke/allkaraoke/node_modules/.bin/../vite/bin/vite.js build (dns block)
    • Triggering command: node ./node_modules/.bin/../vite/bin/vite.js build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Prepare a docker image to build and run the app. It should take node version from .nvmrc file if possible Add Docker support with automatic Node version detection from .nvmrc Aug 21, 2025
Copilot AI requested a review from Asvarox August 21, 2025 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants