services: # Service pour le backend framed-server: build: context: . dockerfile: Dockerfile container_name: framed-tracker-server restart: unless-stopped ports: - "3000:3000" volumes: - ./server:/app - ./data:/app/data - ./backups:/app/backups environment: - NODE_ENV=production - PORT=3000 - DB_PATH=/app/data/framed.db # Service pour le frontend (en développement) framed-client-dev: image: node:18-alpine container_name: framed-tracker-client-dev restart: unless-stopped working_dir: /app ports: - "3001:3001" volumes: - ./client:/app environment: - PORT=3001 - REACT_APP_API_URL=http://localhost:3000/api command: sh -c "npm install && npm start" depends_on: - framed-server # Service pour construire le frontend (production) framed-client-build: image: node:18-alpine container_name: framed-tracker-client-build working_dir: /app volumes: - ./client:/app - ./server/public:/output environment: - REACT_APP_API_URL=/api command: sh -c "npm install && npm run build && cp -r build/* /output/" profiles: - build # Service nginx pour servir l'application en production framed-nginx: image: nginx:alpine container_name: framed-tracker-nginx restart: unless-stopped ports: - "80:80" volumes: - ./nginx/default.conf:/etc/nginx/conf.d/default.conf - ./server/public:/usr/share/nginx/html depends_on: - framed-server profiles: - prod