mirror of
https://github.com/openfaas/faas.git
synced 2025-06-17 12:46:59 +00:00
213 lines
5.9 KiB
YAML
213 lines
5.9 KiB
YAML
version: "3.2"
|
||
services:
|
||
gateway:
|
||
volumes:
|
||
- "/var/run/docker.sock:/var/run/docker.sock"
|
||
ports:
|
||
- 8080:8080
|
||
image: functions/gateway:0.6.13
|
||
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:
|
||
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
|