mirror of
https://github.com/openfaas/faas.git
synced 2025-06-12 18:26:49 +00:00
- Extend stack to include a test function
- Allow _ char in routes - Let Dockerfile shrink by coming from alpine
This commit is contained in:
parent
fe9ada50bd
commit
ea488cf742
@ -4,10 +4,11 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- "/var/run/docker.sock:/var/run/docker.sock"
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
||||||
ports:
|
ports:
|
||||||
- 3000:8080
|
- 8080:8080
|
||||||
image: alexellisio/faas-gateway:latest
|
image: alexellis2/faas-gateway:latest
|
||||||
networks:
|
networks:
|
||||||
- functions
|
- functions
|
||||||
|
|
||||||
prometheus:
|
prometheus:
|
||||||
image: quay.io/prometheus/prometheus:latest
|
image: quay.io/prometheus/prometheus:latest
|
||||||
volumes:
|
volumes:
|
||||||
@ -21,7 +22,20 @@ services:
|
|||||||
no_proxy: "gateway"
|
no_proxy: "gateway"
|
||||||
networks:
|
networks:
|
||||||
- functions
|
- functions
|
||||||
|
|
||||||
|
# Sample functions go here.
|
||||||
|
hubstats:
|
||||||
|
image: alexellis2/faas-dockerhubstats:latest
|
||||||
|
depends_on:
|
||||||
|
- gateway
|
||||||
|
networks:
|
||||||
|
- functions
|
||||||
|
environment:
|
||||||
|
no_proxy: "gateway"
|
||||||
|
https_proxy: $https_proxy
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
functions:
|
functions:
|
||||||
driver: overlay
|
driver: overlay
|
||||||
|
# Docker does not support this option yet - maybe create outside of the stack and reference as "external"?
|
||||||
#attachable: true
|
#attachable: true
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
FROM golang:1.7.3
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
COPY gateway .
|
COPY gateway .
|
||||||
|
@ -185,7 +185,7 @@ func main() {
|
|||||||
r := mux.NewRouter()
|
r := mux.NewRouter()
|
||||||
r.HandleFunc("/", makeProxy(metricsOptions, false))
|
r.HandleFunc("/", makeProxy(metricsOptions, false))
|
||||||
|
|
||||||
r.HandleFunc("/function/{name:[a-zA-Z]+}", makeProxy(metricsOptions, true))
|
r.HandleFunc("/function/{name:[a-zA-Z_]+}", makeProxy(metricsOptions, true))
|
||||||
|
|
||||||
metricsHandler := metrics.PrometheusHandler()
|
metricsHandler := metrics.PrometheusHandler()
|
||||||
r.Handle("/metrics", metricsHandler)
|
r.Handle("/metrics", metricsHandler)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user