generated from Templates/Baseline
OCram85
2c63a3a6fb
All checks were successful
ci / docker (push) Successful in 26s
#### 📖 Summary - adds docker-compose.yml full stack example - fix typos #### 📑 Test Plan > 💡 Select your test plan for the code changes. - [x] CI pipeline tests - [ ] Custom test - [ ] No test plan ##### Details / Justification <!-- Add your test details or justification for missing tests here. --> #### 📚 Additional Notes <!-- A place for additional detail notes. --> Co-authored-by: OCram85 <marco.blessing@googlemail.com> Reviewed-on: #12
67 lines
1.5 KiB
YAML
67 lines
1.5 KiB
YAML
version: "3.8"
|
|
|
|
|
|
# Setting up 3 default networks to act as dummy:
|
|
# - backend : internal only network
|
|
# - dmz : dmz network with connections allowed from internal and external
|
|
# - egress : dummy egress zone with fake upstream proxy
|
|
|
|
networks:
|
|
egress:
|
|
attachable: true
|
|
dmz:
|
|
attachable: true
|
|
backend:
|
|
internal: true
|
|
|
|
services:
|
|
# Creating a fake upstream proxy
|
|
upstream:
|
|
image: gitea.ocram85.com/ocram85/swarmproxy:latest
|
|
deploy:
|
|
replicas: 1
|
|
environment:
|
|
- LOGLEVEL=Info
|
|
networks:
|
|
egress:
|
|
aliases:
|
|
- upstream
|
|
|
|
# Creating our swarmproxy instance to use the external upstream proxy
|
|
swarmproxy:
|
|
# Do not use the `latest` tag in production!
|
|
image: gitea.ocram85.com/ocram85/swarmproxy:latest
|
|
depends_on:
|
|
- upstream
|
|
deploy:
|
|
replicas: 1
|
|
environment:
|
|
- UPSTREAM_PROXY=upstream:8888
|
|
- LOGLEVEL=Info
|
|
networks:
|
|
dmz:
|
|
aliases:
|
|
- swarmproxy
|
|
- proxy
|
|
egress:
|
|
|
|
# container workload example whicht tries to communicate through our swarmproxy instance
|
|
# http request / response:
|
|
# [curl container] <---|req/res|---> [swarmproxy] <---|req/res|---> [upstream] <---|req/res|---> [target]
|
|
curl:
|
|
image: curlimages/curl:8.1.2
|
|
command: ["-I", "-x", "proxy:8888", "https://google.com"]
|
|
depends_on:
|
|
- upstream
|
|
- swarmproxy
|
|
deploy:
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: any
|
|
delay: 10s
|
|
max_attempts: 5
|
|
window: 120s
|
|
networks:
|
|
- backend
|
|
- dmz
|