启动:docker-compose up -d
启动两个whoami实例:docker-compose up -d --scale whoami=2
whoami地址:http://whoami.docker.localhost
web UI地址:http://localhost:8080
traefik API原始数据地址:http://localhost:8080/api/rawdata
| // Copyright 2010 The Go Authors. All rights reserved. | |
| // Use of this source code is governed by a BSD-style | |
| // license that can be found in the LICENSE file. | |
| /* | |
| Go Codewalk: Share Memory By Communicating | |
| Go 代码漫读 - 通过通信共享内存 | |
| https://golang.org/doc/codewalk/sharemem/ | |
| */ |
| /* | |
| A Tour of Go Exercise: Web Crawler | |
| Go语言之旅 - 网络爬虫 | |
| https://tour.golang.org/concurrency/10 | |
| */ | |
| package main | |
| import ( | |
| "fmt" | |
| "sync" |
| /* | |
| A Tour of Go Exercise: Equivalent Binary Trees | |
| Go语言之旅 - 判断两个二叉树是否相等 | |
| https://tour.golang.org/concurrency/8 | |
| */ | |
| package main | |
| import "golang.org/x/tour/tree" | |
| // Walk walks the tree t sending all values |
| version: '3' | |
| services: | |
| gateway: | |
| # 官方最新的 traefik docker 镜像 | |
| # 生产环境建议指定镜像版本号 | |
| image: traefik:latest | |
| # 停止后重新启动 | |
| restart: unless-stopped | |
| # 静态配置可以通过 traefik.toml 文件设置,command 命令参数移至配置文件 |
启动:docker-compose up -d
启动两个whoami实例:docker-compose up -d --scale whoami=2
whoami地址:http://whoami.docker.localhost
web UI地址:http://localhost:8080
traefik API原始数据地址:http://localhost:8080/api/rawdata
| 1. Schedule a cron to execute at 2am daily. | |
| This will be useful for scheduling database backup on daily basis. | |
| 0 2 * * * /bin/sh backup.sh | |
| are used for matching all the records. | |
| 2. Schedule a cron to execute twice a day. | |
| Below example command will execute at 5AM and 5PM daily. You can specify multiple time stamp by comma separated. | |
| 0 5,17 * * * /scripts/script.sh | |
| 3. Schedule a cron to execute on every minutes. |
| #!/usr/bin/env python | |
| # coding:utf-8 | |
| import getopt | |
| import sys | |
| def main(argv): | |
| # Default arguments value |
| # coding:utf-8 | |
| from elasticsearch import Elasticsearch | |
| import json | |
| # Define config | |
| host = "127.0.0.1" | |
| port = 9200 | |
| timeout = 1000 | |
| index = "index" |