services: mediacrawler: build: . image: mediacrawler:latest container_name: mediacrawler restart: unless-stopped # host networking is a requirement, not a convenience: the crawler attaches # to the operator's Chrome at 127.0.0.1:9222, and inside a bridge network # that loopback is the container's own, where no browser is listening. # It also puts the app port directly on the host, so `ports:` is not used. network_mode: host env_file: - .env environment: MC_HOST: 0.0.0.0 MC_PORT: "18051" TZ: Asia/Shanghai volumes: # Per-run crawler output, read back by the monitor layer. Without this the # data would live inside the container and vanish on every rebuild. - ./data:/app/data