services: portainer: image: ${PORTAINER_IMAGE:-portainer/portainer-ce:lts} container_name: portainer restart: unless-stopped environment: - TZ=Asia/Shanghai volumes: - /var/run/docker.sock:/var/run/docker.sock:ro - ${PORTAINER_DATA_DIR:-/var/lib/portainer}:/data - /etc/localtime:/etc/localtime:ro ports: - "127.0.0.1:9000:9000" healthcheck: test: ["CMD", "wget", "--spider", "-q", "http://127.0.0.1:9000/api/system/status"] interval: 30s timeout: 5s retries: 3 start_period: 15s logging: driver: json-file options: max-size: "10m" max-file: "3"