docker-compose.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. services:
  2. # Service pour le backend
  3. framed-server:
  4. build:
  5. context: .
  6. dockerfile: Dockerfile
  7. container_name: framed-tracker-server
  8. restart: unless-stopped
  9. ports:
  10. - "3000:3000"
  11. volumes:
  12. - ./server:/app
  13. - ./data:/app/data
  14. - ./backups:/app/backups
  15. environment:
  16. - NODE_ENV=production
  17. - PORT=3000
  18. - DB_PATH=/app/data/framed.db
  19. - CORS_ORIGINS=https://${HOSTNAME:-localhost}
  20. # Service pour le frontend (en développement)
  21. framed-client-dev:
  22. image: node:18-alpine
  23. container_name: framed-tracker-client-dev
  24. restart: unless-stopped
  25. working_dir: /app
  26. ports:
  27. - "3001:3001"
  28. volumes:
  29. - ./client:/app
  30. environment:
  31. - PORT=3001
  32. ## use hostname env var or localhost
  33. - REACT_APP_API_URL=http://${HOSTNAME:-localhost}/api
  34. - REACT_APP_WS_URL=ws://${HOSTNAME:-localhost}
  35. command: sh -c "npm install && npm start"
  36. depends_on:
  37. - framed-server
  38. # Service pour construire le frontend (production)
  39. framed-client-build:
  40. image: node:18-alpine
  41. container_name: framed-tracker-client-build
  42. working_dir: /app
  43. volumes:
  44. - ./client:/app
  45. - ./server/public:/output
  46. command: sh -c "npm install && npm run build && cp -r build/* /output/"
  47. profiles:
  48. - build