-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Stephan Renatus <[email protected]>
- Loading branch information
Showing
3 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Proxying example for Enterprise OPA | ||
|
||
This demo setup is using docker compose to set up the following: | ||
|
||
```mermaid | ||
graph LR | ||
proxy-->internet | ||
dns-->internet | ||
subgraph internal | ||
eopa-->proxy | ||
eopa-->dns | ||
end | ||
``` | ||
|
||
Enterprise OPA is started with | ||
1. HTTP_PROXY and HTTPS_PROXY set to `proxy:3128` | ||
2. `/etc/resolv.conf` including both the Docker DNS and the DNS proxy | ||
3. **No direct access to the public internet.** | ||
|
||
When starting the stack with `docker compose up`, we'll find Enterprise OPA starting up: | ||
|
||
```raw | ||
enterprise-opa-1 | {"level":"debug","msg":"Server initialized.","time":"2024-08-12T09:49:01Z"} | ||
``` | ||
|
||
Requests to the internet to verify the license go through the proxy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
services: | ||
enterprise-opa: | ||
image: ghcr.io/styrainc/enterprise-opa:latest | ||
ports: | ||
- "8181:8181" | ||
command: | ||
- "run" | ||
- "--server" | ||
- "--addr=0.0.0.0:8181" | ||
- "--log-level=debug" | ||
environment: | ||
EOPA_LICENSE_KEY: ${EOPA_LICENSE_KEY} | ||
HTTP_PROXY: proxy:3128 | ||
HTTPS_PROXY: proxy:3128 | ||
networks: | ||
intnet: {} | ||
depends_on: | ||
- proxy | ||
- dns | ||
volumes: | ||
- ./resolv.conf:/etc/resolv.conf | ||
|
||
dns: | ||
image: coredns/coredns | ||
ports: | ||
- "53:53" | ||
networks: | ||
intnet: {} | ||
extnet: {} | ||
|
||
proxy: | ||
image: hinata/nginx-forward-proxy:latest | ||
ports: | ||
- "3128:3128" | ||
networks: | ||
intnet: {} | ||
extnet: {} | ||
|
||
networks: | ||
intnet: | ||
internal: true | ||
extnet: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
nameserver 127.0.0.11 | ||
nameserver dns |