Files
drone-detector/docs/DOCKER_TROUBLESHOOTING.md
2025-08-16 19:51:04 +02:00

1.8 KiB

Docker Troubleshooting Guide

Common Docker Build Issues

1. Frontend npm ci Error

Error: npm ci fails with "missing package-lock.json" Solution: The Dockerfile has been updated to use npm install instead

docker build --no-cache -t test-frontend ./client

2. Backend Build Dependencies

Error: Native dependencies compilation fails Solution: The backend includes all necessary build tools

docker build --no-cache -t test-backend ./server

3. Missing nginx.conf

Error: nginx.conf not found during frontend build Solution: The nginx configuration is now included in the client directory

# Check if nginx.conf exists
ls client/nginx.conf

4. Docker Compose Network Issues

Error: Services cannot communicate Solution: Use the simplified docker-compose file

docker-compose -f docker-compose.simple.yml up -d

Build Testing

Test builds individually before running docker-compose:

# Linux/Mac
chmod +x test-docker-builds.sh
./test-docker-builds.sh

# Windows
test-docker-builds.bat

Quick Fixes

Reset Everything

docker-compose down -v
docker system prune -f
docker-compose build --no-cache
docker-compose up -d

Check Service Logs

docker-compose logs backend
docker-compose logs frontend
docker-compose logs postgres

Manual Container Testing

# Test backend
docker run -it --rm -p 3001:3001 drone-backend

# Test frontend
docker run -it --rm -p 3000:80 drone-frontend

Performance Issues

Increase Docker Resources

  • Increase Docker Desktop memory to 4GB+
  • Increase Docker Desktop CPU to 4+ cores
  • Enable Docker BuildKit for faster builds

Build Optimization

# Use BuildKit for faster builds
export DOCKER_BUILDKIT=1
docker-compose build

# Parallel builds
docker-compose build --parallel