Fix jwt-token
This commit is contained in:
@@ -41,6 +41,21 @@ docker-compose ps
|
||||
- **Database**: localhost:5432
|
||||
- **Redis**: localhost:6379
|
||||
|
||||
### Testing Docker Builds
|
||||
|
||||
Before running the full docker-compose setup, you can test individual container builds:
|
||||
|
||||
```bash
|
||||
# Test all builds
|
||||
./test-docker-builds.sh # Linux/Mac
|
||||
test-docker-builds.bat # Windows
|
||||
|
||||
# Test individual builds
|
||||
docker build -t test-backend ./server
|
||||
docker build -t test-frontend ./client
|
||||
docker build -f docker/simulator/Dockerfile -t test-simulator .
|
||||
```
|
||||
|
||||
## Service Architecture
|
||||
|
||||
```
|
||||
@@ -220,9 +235,15 @@ docker-compose up -d
|
||||
|
||||
#### 2. Frontend Build Issues
|
||||
```bash
|
||||
# If npm ci fails (missing package-lock.json)
|
||||
# The Dockerfile has been updated to use npm install instead
|
||||
|
||||
# Rebuild frontend
|
||||
docker-compose build --no-cache frontend
|
||||
|
||||
# Test frontend build individually
|
||||
docker build -t test-frontend ./client
|
||||
|
||||
# Check build logs
|
||||
docker-compose logs frontend
|
||||
```
|
||||
|
||||
88
docs/DOCKER_TROUBLESHOOTING.md
Normal file
88
docs/DOCKER_TROUBLESHOOTING.md
Normal file
@@ -0,0 +1,88 @@
|
||||
# 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
|
||||
```bash
|
||||
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
|
||||
```bash
|
||||
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
|
||||
```bash
|
||||
# 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
|
||||
```bash
|
||||
docker-compose -f docker-compose.simple.yml up -d
|
||||
```
|
||||
|
||||
## Build Testing
|
||||
|
||||
Test builds individually before running docker-compose:
|
||||
|
||||
```bash
|
||||
# Linux/Mac
|
||||
chmod +x test-docker-builds.sh
|
||||
./test-docker-builds.sh
|
||||
|
||||
# Windows
|
||||
test-docker-builds.bat
|
||||
```
|
||||
|
||||
## Quick Fixes
|
||||
|
||||
### Reset Everything
|
||||
```bash
|
||||
docker-compose down -v
|
||||
docker system prune -f
|
||||
docker-compose build --no-cache
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
### Check Service Logs
|
||||
```bash
|
||||
docker-compose logs backend
|
||||
docker-compose logs frontend
|
||||
docker-compose logs postgres
|
||||
```
|
||||
|
||||
### Manual Container Testing
|
||||
```bash
|
||||
# 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
|
||||
```bash
|
||||
# Use BuildKit for faster builds
|
||||
export DOCKER_BUILDKIT=1
|
||||
docker-compose build
|
||||
|
||||
# Parallel builds
|
||||
docker-compose build --parallel
|
||||
```
|
||||
Reference in New Issue
Block a user