docker-compose.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. version: '3.8'
  2. services:
  3. postgres:
  4. image: postgres:16-alpine
  5. environment:
  6. POSTGRES_DB: gestion_locative
  7. POSTGRES_USER: postgres
  8. POSTGRES_PASSWORD: postgres
  9. volumes:
  10. - postgres_data:/var/lib/postgresql/data
  11. ports:
  12. - "5432:5432"
  13. restart: unless-stopped
  14. backend:
  15. build:
  16. context: ./backend
  17. dockerfile: Dockerfile
  18. ports:
  19. - "3001:3001"
  20. volumes:
  21. - ./backend/uploads:/app/uploads
  22. environment:
  23. - NODE_ENV=production
  24. - JWT_SECRET=change_this_secret_in_production
  25. - PGHOST=postgres
  26. - PGPORT=5432
  27. - PGUSER=postgres
  28. - PGPASSWORD=postgres
  29. - PGDATABASE=gestion_locative
  30. # SSO OIDC (optionnel — laisser vide pour désactiver)
  31. - OIDC_ISSUER=${OIDC_ISSUER:-}
  32. - OIDC_CLIENT_ID=${OIDC_CLIENT_ID:-}
  33. - OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET:-}
  34. - OIDC_REDIRECT_URI=${OIDC_REDIRECT_URI:-http://localhost:3001/api/auth/oidc/callback}
  35. - OIDC_SCOPE=${OIDC_SCOPE:-openid email profile}
  36. - OIDC_BUTTON_LABEL=${OIDC_BUTTON_LABEL:-Se connecter via SSO}
  37. - FRONTEND_URL=${FRONTEND_URL:-http://localhost:3000}
  38. # INSEE API (optionnel — pour récupérer l'IRL automatiquement)
  39. - INSEE_API_TOKEN=${INSEE_API_TOKEN:-}
  40. depends_on:
  41. - postgres
  42. restart: unless-stopped
  43. frontend:
  44. build:
  45. context: ./frontend
  46. dockerfile: Dockerfile
  47. ports:
  48. - "3000:80"
  49. environment:
  50. - BACKEND_URL=${BACKEND_URL:-http://backend:3001}
  51. depends_on:
  52. - backend
  53. restart: unless-stopped
  54. volumes:
  55. postgres_data: