Skip to content

Instantly share code, notes, and snippets.

@akeshavan
Created December 19, 2017 18:56
Show Gist options
  • Select an option

  • Save akeshavan/aa62d195ce36630e07f77aae86599be7 to your computer and use it in GitHub Desktop.

Select an option

Save akeshavan/aa62d195ce36630e07f77aae86599be7 to your computer and use it in GitHub Desktop.
version: "3.2"
services:
traefik:
image: traefik:v1.3
command: -c --docker=true
--docker.swarmmode=true
--docker.domain=traefik
--docker.watch=true
--web=true
--debug=true
--defaultEntryPoints='http,https'
--acme=true
--acme.domains='mydomain.com,www.mydomain.com'
--acme.email=my@email.com
--acme.ondemand=true
--acme.onhostrule=true
--acme.storage=/etc/traefik/acme/acme.json
--entryPoints='Name:https Address::443 TLS'
--entryPoints='Name:http Address::80'
ports:
- 80:80
- 8080:8080
- 443:443
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "acme:/etc/traefik/acme"
networks:
- functions
deploy:
placement:
constraints: [node.role == manager]
gateway:
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
#ports:
# - 8080:8080
image: functions/gateway:0.6.14
networks:
- functions
environment:
read_timeout: 10 # set both here, and on your functions
write_timeout: 10 # set both here, and on your functions
dnsrr: "true" # Temporarily use dnsrr in place of VIP while issue persists on PWD
deploy:
labels:
- traefik.port=8080
- traefik.frontend.rule=PathPrefix:/ui,/system,/function
- traefik.frontend.auth.basic=user:$$apr1$$ #copy/paste the contents of password.txt here
resources:
limits:
memory: 100M
reservations:
memory: 50M
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 20
window: 380s
placement:
constraints:
- 'node.role == manager'
- 'node.platform.os == linux'
# End
# Start monitoring
prometheus:
image: functions/prometheus:latest # autobuild from Dockerfile in repo.
command: "-config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -storage.local.memory-chunks=10000 --alertmanager.url=http://alertmanager:9093"
ports:
- 9090:9090
environment:
no_proxy: "gateway"
networks:
- functions
deploy:
resources:
limits:
memory: 500M
reservations:
memory: 200M
placement:
constraints:
- 'node.role == manager'
- 'node.platform.os == linux'
alertmanager:
image: functions/alertmanager:latest # autobuild from Dockerfile in repo.
environment:
no_proxy: "gateway"
command:
- '-config.file=/alertmanager.yml'
networks:
- functions
# Uncomment the following port mapping if you wish to expose the Prometheus
# Alertmanager UI.
# ports:
# - 9093:9093
deploy:
resources:
limits:
memory: 50M
reservations:
memory: 20M
placement:
constraints:
- 'node.role == manager'
- 'node.platform.os == linux'
# Sample functions go here.
# Service label of "function" allows functions to show up in UI on http://gateway:8080/
webhookstash:
image: functions/webhookstash:latest
labels:
function: "true"
networks:
- functions
environment:
no_proxy: "gateway"
https_proxy: $https_proxy
deploy:
placement:
constraints:
- 'node.platform.os == linux'
# Pass a username as an argument to find how many images user has pushed to Docker Hub.
hubstats:
image: functions/hubstats:latest
labels:
function: "true"
networks:
- functions
environment:
no_proxy: "gateway"
https_proxy: $https_proxy
deploy:
placement:
constraints:
- 'node.platform.os == linux'
# Node.js gives OS info about the node (Host)
nodeinfo:
image: functions/nodeinfo:latest
labels:
function: "true"
networks:
- functions
environment:
no_proxy: "gateway"
https_proxy: $https_proxy
deploy:
placement:
constraints:
- 'node.platform.os == linux'
# Uses `cat` to echo back response, fastest function to execute.
echoit:
image: functions/alpine:latest
labels:
function: "true"
networks:
- functions
environment:
fprocess: "cat"
no_proxy: "gateway"
https_proxy: $https_proxy
deploy:
placement:
constraints:
- 'node.platform.os == linux'
# Counts words in request with `wc` utility
wordcount:
image: functions/alpine:latest
labels:
function: "true"
com.faas.max_replicas: "10"
networks:
- functions
environment:
fprocess: "wc"
no_proxy: "gateway"
https_proxy: $https_proxy
deploy:
placement:
constraints:
- 'node.platform.os == linux'
# Calculates base64 representation of request body.
base64:
image: functions/alpine:latest
labels:
function: "true"
networks:
- functions
environment:
fprocess: "base64"
no_proxy: "gateway"
https_proxy: $https_proxy
deploy:
placement:
constraints:
- 'node.platform.os == linux'
# Decodes base64 representation of request body.
decodebase64:
image: functions/alpine:latest
labels:
function: "true"
networks:
- functions
environment:
fprocess: "base64 -d"
no_proxy: "gateway"
https_proxy: $https_proxy
deploy:
placement:
constraints:
- 'node.platform.os == linux'
# Converts body in (markdown format) -> (html)
markdown:
image: functions/markdown-render:latest
labels:
function: "true"
networks:
- functions
environment:
no_proxy: "gateway"
https_proxy: $https_proxy
deploy:
placement:
constraints:
- 'node.platform.os == linux'
networks:
functions:
driver: overlay
#attachable: true
volumes:
acme:
func_traefik.1.yvz36sywqhqx@ip-172-30-0-50 | time="2017-12-19T18:32:07Z" level=info msg="Traefik version v1.3.8 built on 2017-09-07_08:46:19PM"
func_traefik.1.z6eiw11s4one@ip-172-30-0-50 | time="2017-12-19T18:38:45Z" level=info msg="Traefik version v1.3.8 built on 2017-09-07_08:46:19PM"
func_traefik.1.yiu8p7watgnn@ip-172-30-0-50 | time="2017-12-19T18:28:27Z" level=info msg="Traefik version v1.3.8 built on 2017-09-07_08:46:19PM"
func_traefik.1.yiu8p7watgnn@ip-172-30-0-50 | time="2017-12-19T18:28:27Z" level=debug msg="Global configuration loaded {"GraceTimeOut":10000000000,"Debug":true,"CheckNewVersion":true,"AccessLogsFile":"","TraefikLogsFile":"","LogLevel":"DEBUG","EntryPoints":{"http":{"Network":"","Address":":80","TLS":null,"Redirect":null,"Auth":null,"Compress":false},"https":{"Network":"","Address":":443","TLS":{"MinVersion":"","CipherSuites":null,"Certificates":[],"ClientCAFiles":null},"Redirect":null,"Auth":null,"Compress":false}},"Cluster":null,"Constraints":[],"ACME":{"Email":"my@email.com","Domains":[{"Main":"mydomain.com","SANs":[" www.mydomain.com"]}],"Storage":"/etc/traefik/acme/acme.json","StorageFile":"","OnDemand":true,"OnHostRule":true,"CAServer":"","EntryPoint":"","DNSProvider":"","DelayDontCheckDNS":0,"ACMELogging":false,"TLSConfig":null},"DefaultEntryPoints":["http","https"],"ProvidersThrottleDuration":2000000000,"MaxIdleConnsPerHost":200,"IdleTimeout":180000000000,"InsecureSkipVerify":false,"Retry":null,"HealthCheck":{"Interval":30000000000},"Docker":{"Watch":true,"Filename":"","Constraints":null,"Endpoint":"unix:///var/run/docker.sock","Domain":"traefik","TLS":null,"ExposedByDefault":true,"UseBindPortIP":false,"SwarmMode":true},"File":null,"Web":{"Address":":8080","CertFile":"","KeyFile":"","ReadOnly":false,"Statistics":null,"Metrics":null,"Path":"","Auth":null},"Marathon":null,"Consul":null,"ConsulCatalog":null,"Etcd":null,"Zookeeper":null,"Boltdb":null,"Kubernetes":null,"Mesos":null,"Eureka":null,"ECS":null,"Rancher":null,"DynamoDB":null}"
func_traefik.1.yvz36sywqhqx@ip-172-30-0-50 | time="2017-12-19T18:32:07Z" level=debug msg="Global configuration loaded {"GraceTimeOut":10000000000,"Debug":true,"CheckNewVersion":true,"AccessLogsFile":"","TraefikLogsFile":"","LogLevel":"DEBUG","EntryPoints":{"http":{"Network":"","Address":":80","TLS":null,"Redirect":null,"Auth":null,"Compress":false},"https":{"Network":"","Address":":443","TLS":{"MinVersion":"","CipherSuites":null,"Certificates":[],"ClientCAFiles":null},"Redirect":null,"Auth":null,"Compress":false}},"Cluster":null,"Constraints":[],"ACME":{"Email":"my@email.com","Domains":[{"Main":"mydomain.com","SANs":[" www.mydomain.com"]}],"Storage":"","StorageFile":"","OnDemand":true,"OnHostRule":true,"CAServer":"","EntryPoint":"","DNSProvider":"","DelayDontCheckDNS":0,"ACMELogging":false,"TLSConfig":null},"DefaultEntryPoints":["http","https"],"ProvidersThrottleDuration":2000000000,"MaxIdleConnsPerHost":200,"IdleTimeout":180000000000,"InsecureSkipVerify":false,"Retry":null,"HealthCheck":{"Interval":30000000000},"Docker":{"Watch":true,"Filename":"","Constraints":null,"Endpoint":"unix:///var/run/docker.sock","Domain":"traefik","TLS":null,"ExposedByDefault":true,"UseBindPortIP":false,"SwarmMode":true},"File":null,"Web":{"Address":":8080","CertFile":"","KeyFile":"","ReadOnly":false,"Statistics":null,"Metrics":null,"Path":"","Auth":null},"Marathon":null,"Consul":null,"ConsulCatalog":null,"Etcd":null,"Zookeeper":null,"Boltdb":null,"Kubernetes":null,"Mesos":null,"Eureka":null,"ECS":null,"Rancher":null,"DynamoDB":null}"
func_traefik.1.z6eiw11s4one@ip-172-30-0-50 | time="2017-12-19T18:38:45Z" level=debug msg="Global configuration loaded {"GraceTimeOut":10000000000,"Debug":true,"CheckNewVersion":true,"AccessLogsFile":"","TraefikLogsFile":"","LogLevel":"DEBUG","EntryPoints":{"http":{"Network":"","Address":":80","TLS":null,"Redirect":null,"Auth":null,"Compress":false},"https":{"Network":"","Address":":443","TLS":{"MinVersion":"","CipherSuites":null,"Certificates":[],"ClientCAFiles":null},"Redirect":null,"Auth":null,"Compress":false}},"Cluster":null,"Constraints":[],"ACME":{"Email":"my@email.com","Domains":[{"Main":"mydomain.com","SANs":[" www.mydomain.com"]}],"Storage":"","StorageFile":"","OnDemand":true,"OnHostRule":true,"CAServer":"","EntryPoint":"","DNSProvider":"","DelayDontCheckDNS":0,"ACMELogging":false,"TLSConfig":null},"DefaultEntryPoints":["http","https"],"ProvidersThrottleDuration":2000000000,"MaxIdleConnsPerHost":200,"IdleTimeout":180000000000,"InsecureSkipVerify":false,"Retry":null,"HealthCheck":{"Interval":30000000000},"Docker":{"Watch":true,"Filename":"","Constraints":null,"Endpoint":"unix:///var/run/docker.sock","Domain":"traefik","TLS":null,"ExposedByDefault":true,"UseBindPortIP":false,"SwarmMode":true},"File":null,"Web":{"Address":":8080","CertFile":"","KeyFile":"","ReadOnly":false,"Statistics":null,"Metrics":null,"Path":"","Auth":null},"Marathon":null,"Consul":null,"ConsulCatalog":null,"Etcd":null,"Zookeeper":null,"Boltdb":null,"Kubernetes":null,"Mesos":null,"Eureka":null,"ECS":null,"Rancher":null,"DynamoDB":null}"
func_traefik.1.z6eiw11s4one@ip-172-30-0-50 | time="2017-12-19T18:38:45Z" level=info msg="Preparing server https &{Network: Address::443 TLS:0xc42004b140 Redirect:<nil> Auth:<nil> Compress:false}"
func_traefik.1.yiu8p7watgnn@ip-172-30-0-50 | time="2017-12-19T18:28:27Z" level=info msg="Preparing server https &{Network: Address::443 TLS:0xc42034ad20 Redirect:<nil> Auth:<nil> Compress:false}"
func_traefik.1.yvz36sywqhqx@ip-172-30-0-50 | time="2017-12-19T18:32:07Z" level=info msg="Preparing server https &{Network: Address::443 TLS:0xc42028cba0 Redirect:<nil> Auth:<nil> Compress:false}"
func_traefik.1.yvz36sywqhqx@ip-172-30-0-50 | time="2017-12-19T18:32:07Z" level=error msg="Error creating TLS config: Unknown entrypoint for ACME configuration"
func_traefik.1.z6eiw11s4one@ip-172-30-0-50 | time="2017-12-19T18:38:45Z" level=error msg="Error creating TLS config: Unknown entrypoint for ACME configuration"
func_traefik.1.yiu8p7watgnn@ip-172-30-0-50 | time="2017-12-19T18:28:27Z" level=error msg="Error creating TLS config: Unknown entrypoint for ACME configuration"
func_traefik.1.yiu8p7watgnn@ip-172-30-0-50 | time="2017-12-19T18:28:27Z" level=fatal msg="Error preparing server: Unknown entrypoint for ACME configuration"
func_traefik.1.yvz36sywqhqx@ip-172-30-0-50 | time="2017-12-19T18:32:07Z" level=fatal msg="Error preparing server: Unknown entrypoint for ACME configuration"
func_traefik.1.z6eiw11s4one@ip-172-30-0-50 | time="2017-12-19T18:38:45Z" level=fatal msg="Error preparing server: Unknown entrypoint for ACME configuration"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment