php - Docker - Run Apache on host and container for different websites -


i want use docker in order able run old application requires php 5.3, while still having other websites on host server, running on host apache.

so have sitea.com, siteb.com, sitec.com running on host, using host apache / php / mysql server, , have sitez.com installed in docker container, should using container's apache / php host mysql server.

here's representation of architecture i'd obtain :

representation of architecture

my issue seems can't run apache in container, since port 80 in use on host.

my goal people access sitea.com, siteb.com, sitec.com , sitez.com, without having specify different port of websites.

i managed sitez.com running using port 8080, it's not option.

thanks

ps : please note i'm completly new docker.

edit : can find working solution here. vonc showing me way go :)

i can't run apache in container, since port 80 in use on host.

sure can: in container, can run apache on port want.

but when docker run, then need map container port host port (which won't 80, since taken, instance 8080

docker run -d -p 8080:80 yourimage 

my goal people access sitea.com, siteb.com, sitec.com , sitez.com

that called reverse proxy, , run on port 80 nginx (in container or not) reverse proxy sitea, b or c (each running on different port, in container or not).
see instance "nginx reverse proxy multiple ssl domain".

your main apache wouldn't run directly on port 80 anymore (or could, if put in container!)

the goal behind putting in own container isolation.
not filesystem isolation chroot, or memory isolation, configuration isolation: in container, apache run (if want) in 80/443, not matter how many apache containers running.
launch them proper host port mapping, inside container, config remains fixed , identical.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -