auth-backend: add example setup for oauth2-proxy

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-05-02 16:44:51 +02:00
parent 4cf2eb8566
commit ba901234cf
@@ -0,0 +1,43 @@
#!/usr/bin/env docker-compose -f
# This docker compose file can be used to try out the oauth2-proxy auth provider.
# You'll need to provide your own GitHub client ID and secret through
# GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET.
#
# The following env vars can be used to configure `yarn dev` to work with the proxy:
#
# APP_CONFIG_app_baseUrl=http://localhost APP_CONFIG_app_listen_port=3000 \
# APP_CONFIG_backend_baseUrl=http://localhost APP_CONFIG_backend_listen_port=7007 yarn dev
#
# The only manual modification you need to make to the app is to switch the
# SignInPage to the following:
#
# <ProxiedSignInPage {...props} provider="myproxy" />
#
# Once done, you can run the following and then navigate to http://localhost:
#
# ./docker-compose.oauth2-proxy.yaml up
version: '3'
services:
proxy:
container_name: oauth2-proxy
image: quay.io/oauth2-proxy/oauth2-proxy:v7.2.1
# The below config assumes that you are running the frontend and backend
# in development mode, and that `host.docker.internal` resolves to the host machine.
command: >-
--cookie-secret=super-super-secret-cookie-secret
--cookie-secure=false
--http-address=0.0.0.0:80
--email-domain=*
--provider=github
--client-id=${GITHUB_CLIENT_ID}
--client-secret=${GITHUB_CLIENT_SECRET}
--redirect-url=http://localhost/oauth2/callback
--upstream=http://host.docker.internal:7007/api/,http://host.docker.internal:3000
ports:
- 80:80