version: "3.9" services: backend: build: context: ./server environment: # Spotify API Configuration - SPOTIFY_CLIENT_ID=${SPOTIFY_CLIENT_ID} - SPOTIFY_CLIENT_SECRET=${SPOTIFY_CLIENT_SECRET} - JELLYFIN_URL=${JELLYFIN_URL} - JELLYFIN_API_KEY=${JELLYFIN_API_KEY} - CLIENT_ID=5f573c9620494bae87890c0f08a60293 - CLIENT_SECRET=212476d9b0f3472eaa762d90b19b0ba8 # Server Configuration - PORT=5140 - HOST=0.0.0.0 - PYTHONUNBUFFERED=1 - FLASK_ENV=production # Download Paths (using single quotes to prevent shell expansion) - TRACK_OUTPUT='/data/{artist}/{album} - ({year})/{artist} - {title}.{output-ext}' - ALBUM_OUTPUT='/data/{artist}/{album} - ({year})/{artist} - {title}.{output-ext}' - PLAYLIST_OUTPUT='/data/{list-name}/{artist}/{title}.{output-ext}' - ARTIST_OUTPUT='/data/{artist}/{album} - ({year})/{artist} - {title}.{output-ext}' # Jellyfin Integration - TRIGGER_JELLYFIN_SCAN=True # Playlist Configuration - GENERATE_M3U_PLAYLIST=True - M3U_PLAYLIST_NAME=samcloud_music - M3U_PLAYLIST_PATH=/music/playlists - ABSOLUTE_SERVER_PATH=/music # Logging - EXTRA_LOGGING=True volumes: - /Volumes/Jellyfin Media/Music:/music # Final music files - /Volumes/Jellyfin Media/Music/temp:/temp # Temporary files - ./server:/app - temp_data:/temp - /etc/localtime:/etc/localtime:ro # Sync time with host ports: - "5140:5140" restart: unless-stopped networks: - app-network # Resource limits mem_limit: 2g cpus: 1.5 # Health check healthcheck: test: ["CMD", "curl", "-f", "http://localhost:5140/status"] interval: 30s timeout: 10s retries: 3 start_period: 60s ui: image: node:20 working_dir: /app environment: # Development URLs - use localhost so browser can reach backend - VITE_SERVER_URL=http://localhost:5143 - VITE_BACKEND_URL=http://localhost:5140 # Production URLs for live site - VITE_BACKEND_URL_PROD=https://api.samcloud.ca - VITE_FRONTEND_URL_PROD=https://music.samcloud.ca # Build configuration - NODE_ENV=development volumes: - ./:/app ports: - "5143:5143" command: sh -c "yarn install && yarn dev -- --host 0.0.0.0 --port 5143" restart: unless-stopped depends_on: - backend networks: - app-network networks: app-network: driver: bridge volumes: temp_data: