- Extend stack to include a test function

- Allow _ char in routes
- Let Dockerfile shrink by coming from alpine
This commit is contained in:
Alex Ellis 2017-01-09 17:34:24 +00:00
parent fe9ada50bd
commit ea488cf742
3 changed files with 17 additions and 4 deletions

View File

@ -4,10 +4,11 @@ services:
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
ports:
- 3000:8080
image: alexellisio/faas-gateway:latest
- 8080:8080
image: alexellis2/faas-gateway:latest
networks:
- functions
prometheus:
image: quay.io/prometheus/prometheus:latest
volumes:
@ -21,7 +22,20 @@ services:
no_proxy: "gateway"
networks:
- 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:
functions:
driver: overlay
# Docker does not support this option yet - maybe create outside of the stack and reference as "external"?
#attachable: true

View File

@ -1,4 +1,3 @@
FROM golang:1.7.3
FROM alpine:latest
COPY gateway .

View File

@ -185,7 +185,7 @@ func main() {
r := mux.NewRouter()
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()
r.Handle("/metrics", metricsHandler)