Page MenuHomePhabricator

docker-compose for simulating an app that must run behind an http proxy

Authored By
CDanis
Nov 12 2024, 5:41 PM
Size
769 B
Referenced Files
None
Subscribers
None

docker-compose for simulating an app that must run behind an http proxy

version: '3.8'
services:
proxy:
image: ubuntu/squid:latest # Lightweight and configurable proxy server
container_name: proxy
networks:
- internal
- external
restart: unless-stopped
# This example doesn't work as-is, unless if you docker compose up proxy *first*,
# and wait for it to finish initialization.
app:
image: curlimages/curl:latest # Using a simple curl container for testing purposes
container_name: app
networks:
- internal
depends_on:
- proxy
environment:
- http_proxy=http://proxy:3128
- https_proxy=http://proxy:3128
command: ["curl", "https://example.com"] # Replace this with the actual app's start command
networks:
internal:
internal: true
external:

File Metadata

Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18953974
Default Alt Text
docker-compose for simulating an app that must run behind an http proxy (769 B)

Event Timeline