- 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: 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

View File

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

View File

@ -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)