In the last post i made a configuration to set up an API. Now the goal is to make an other Docker image to connect a front app (for me AngularJS) to the API. The front never access the back itself, it’s for that we make a proxy on /api to do the work. So we need:
- Apache 2.4
- enable proxy mod
Nothing complicated, looks like the last configuration except we don’t need php anymore. As it’s also a dev version the directory project doesn’t need to be inside the container, sharing the local one will be enough.
The real problem was the way to configure the proxy and I lately find a good solution:
It was quite simple as we can set environment variables and the apache configuration can use them.
All is avalaible on my github : Docker-Apache-2.4-Proxy
At this point we can quickly set an environement for the back and the front using Docker! No more time to waste with local server and adding vhosts every time we need.
The next part will be about a postgresl and phppgadmin configuration.