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: