xpeditis2.0/docker-compose.dev.yml
David 88f0cc99bb fix: enable Tailwind CSS compilation in Docker builds
CRITICAL FIX: Frontend was serving raw CSS with uncompiled @tailwind directives,
resulting in completely unstyled pages (plain text without any CSS).

Root cause:
- postcss.config.js and tailwind.config.js/ts were excluded in .dockerignore
- This prevented PostCSS/Tailwind from compiling CSS during Docker builds
- Local builds worked because config files were present

Changes:
1. apps/frontend/.dockerignore:
   - Commented out postcss.config.js exclusion
   - Commented out tailwind.config.js/ts exclusions
   - Added explanatory comments about why these files are needed

2. apps/backend/Dockerfile:
   - Copy src/ directory to production stage for CSV upload paths
   - Create csv-storage/rates directory with proper permissions
   - Fix EACCES errors when uploading CSV files

3. apps/backend/src/application/controllers/admin/csv-rates.controller.ts:
   - Add getCsvUploadPath() helper function
   - Support both local dev and Docker environments
   - Use absolute paths instead of relative paths

4. docker-compose.dev.yml:
   - Change backend port mapping to 4001:4000 (avoid local dev conflicts)
   - Change frontend port mapping to 3001:3000
   - Update CORS_ORIGIN and NEXT_PUBLIC_API_URL accordingly

Impact:
-  Fixes completely broken frontend CSS in Docker/production
-  Applies to CI/CD builds (uses apps/frontend/.dockerignore)
-  Applies to Portainer deployments (pulls from CI/CD images)
-  Fixes CSV upload permission errors in backend
-  Enables local Docker testing on Mac ARM64

Testing:
- Local Docker build now shows compiled Tailwind CSS (60KB+)
- Frontend displays properly styled pages at http://localhost:3001
- Backend CSV uploads work without permission errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 13:39:05 +01:00

96 lines
2.2 KiB
YAML

version: '3.8'
# Build local pour Mac ARM64
services:
postgres:
image: postgres:15-alpine
container_name: xpeditis-postgres-dev
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_DB: xpeditis_dev
POSTGRES_USER: xpeditis
POSTGRES_PASSWORD: xpeditis_dev_password
healthcheck:
test: ["CMD-SHELL", "pg_isready -U xpeditis"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: xpeditis-redis-dev
ports:
- "6379:6379"
command: redis-server --requirepass xpeditis_redis_password
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
minio:
image: minio/minio:latest
container_name: xpeditis-minio-dev
ports:
- "9000:9000"
- "9001:9001"
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
backend:
build:
context: ./apps/backend
dockerfile: Dockerfile
container_name: xpeditis-backend-dev
ports:
- "4001:4000"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
environment:
NODE_ENV: development
PORT: 4000
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_USER: xpeditis
DATABASE_PASSWORD: xpeditis_dev_password
DATABASE_NAME: xpeditis_dev
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: xpeditis_redis_password
JWT_SECRET: dev-secret-key
AWS_S3_ENDPOINT: http://minio:9000
AWS_REGION: us-east-1
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
AWS_S3_BUCKET: xpeditis-csv-rates
CORS_ORIGIN: http://localhost:3001
frontend:
build:
context: ./apps/frontend
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_URL: http://localhost:4001
container_name: xpeditis-frontend-dev
ports:
- "3001:3000"
depends_on:
- backend
environment:
NEXT_PUBLIC_API_URL: http://localhost:4001
volumes:
postgres_data:
redis_data:
minio_data: