docker-compose.yml 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. depends_on:
  31. - postgres
  32. restart: unless-stopped
  33. frontend:
  34. build:
  35. context: ./frontend
  36. dockerfile: Dockerfile
  37. args:
  38. VITE_API_URL: http://localhost:3001
  39. ports:
  40. - "3000:80"
  41. depends_on:
  42. - backend
  43. restart: unless-stopped
  44. volumes:
  45. postgres_data: