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: # The code is mounted rather than baked in, so shipping a change is # "re-upload the tarball, restart" instead of an image rebuild. Only the # dependencies live in the image, because those are the expensive part and # they change rarely -- rebuild only when requirements.txt or the # Dockerfile itself changes. - ./:/app