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 - CORS_ORIGINS=https://${HOSTNAME:-localhost} # 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 ## use hostname env var or localhost - REACT_APP_API_URL=http://${HOSTNAME:-localhost}/api - REACT_APP_WS_URL=ws://${HOSTNAME:-localhost} 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 command: sh -c "npm install && npm run build && cp -r build/* /output/" profiles: - build