Skip to content

Instantly share code, notes, and snippets.

@omo
Created February 1, 2021 05:26
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save omo/cafc8392d79a5178f72de3f99360a268 to your computer and use it in GitHub Desktop.
Save omo/cafc8392d79a5178f72de3f99360a268 to your computer and use it in GitHub Desktop.
oauth2-proxy on Cloud Run
FROM alpine:3.13
WORKDIR /opt/draft-proxy
RUN apk update && apk add git curl
RUN curl -L -o package.tgz https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v6.1.1/oauth2-proxy-v6.1.1.linux-amd64.tar.gz && \
tar xvzf package.tgz && \
mv oauth2-proxy-*.linux-amd64/oauth2-proxy .
CMD ["./oauth2-proxy", \
"--provider=github", "--github-org=YOUR_GITHUB_ORG", "--email-domain=*", \
"--http-address=0.0.0.0:8080", \
"--reverse-proxy=true", \
"--upstream=https://YOUR_DRAFT_SITE_DOMAIN/", \
"--pass-host-header=false", \
"--redirect-url=https://CNAME_FOR_YOUR_DRAFT_SITE/oauth2/callback", \
"--client-id=GITHUB_APP_CLIENT_ID", \
"--client-secret=GITHUB_APP_CLIENT_SECRET", \
"--cookie-secret=RANDOM_STRING_OF_LENGTH_32"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment