Skip to content

Instantly share code, notes, and snippets.

View brianpgerson's full-sized avatar

Brian Gerson brianpgerson

View GitHub Profile
syntax = "proto3";
package hello;
message HelloRequest {
string name = 1;
}
message HelloResponse {
package main
import (
"context"
"fmt"
"log"
pb "envoy_example/protos"
"google.golang.org/grpc"
package main
import (
"context"
"fmt"
"log"
"net"
pb "envoy_example/protos"
FROM golang:latest as builder
COPY . /server
WORKDIR /server
ENV GO111MODULE=on
RUN CGO_ENABLED=0 GOOOS=linux go build -o serverexec ./server/main.go
FROM alpine:latest
WORKDIR /root/
COPY --from=builder /server .
FROM envoyproxy/envoy-dev:latest
CMD /usr/local/bin/envoy -c /etc/envoy.yaml -l debug --service-cluster proxy
version: "3.7"
services:
server:
build:
context: .
dockerfile: Dockerfile.server
networks:
- envoymesh
expose:
admin:
access_log_path: /tmp/admin_access.log
address:
socket_address: { address: 0.0.0.0, port_value: 8888 }
static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 0.0.0.0, port_value: 1337 }
package main
import (
"context"
"fmt"
"net"
"strings"
core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
auth "github.com/envoyproxy/go-control-plane/envoy/service/auth/v2"
FROM golang:latest as builder
COPY . /extauth
WORKDIR /extauth
ENV GO111MODULE=on
RUN CGO_ENABLED=0 GOOOS=linux go build -o extauthexec ./extauth/main.go
FROM alpine:latest
WORKDIR /root/
COPY --from=builder /extauth .
FROM golang:latest as builder
COPY . /extauth_http
WORKDIR /extauth_http
ENV GO111MODULE=on
RUN CGO_ENABLED=0 GOOOS=linux go build -o httpauthexec ./extauth_http/main.go
FROM alpine:latest
WORKDIR /root/
COPY --from=builder /extauth_http .