How do I use ProxyPass in Apache config that links to a different container? hard coding ip address works, but is there a more generic way to do this?
Container1: apache listens on port 443 proxy passes it to Container2 port 3000
Container2: Runs any Flask/Dancer app that listens on port 3000
#docker-compose.yml
version: '3'
services:
apache:
...
ports:
- "443:443"
container_name: Container1
network_mode: "bridge"
depends_on:
- web
web:
...
container_name: Container2
network_mode: "bridge"
-
#apache config
<VirtualHost *:443>
...
ProxyPreserveHost on
# Works but with ip
#ProxyPass / http://ip-of-container2:3000/
#ProxyPassReverse / http://ip-of-container2:3000/
ProxyPass / http://Container2:3000/
ProxyPassReverse / http://Container2:3000/
</VirtualHost>